By Brett McLaughlin, Justin Edelson
Book Price: $49.99 USD
£35.50 GBP
PDF Price: $39.99
[ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ], [ Symbols ], [ A ],
A[ Top ]
A9 Open Search module, 370
AbstractView interface, 139
accept( ) method
EventFilter and StreamFilter, 224
Node interface, 290
acceptNode( ) (NodeFilter), 132
Action interface, 306
ActionScript, 415
XML in ActionScript 3.0, 417-429
E4X, 420
Flash XML sockets, 423-426
sending and loading XML, 421
XML data providers, 421
ActiveX control, XMLHttpRequest as, 402
addContent( ) method, 245, 252, 253, 263
addElement( ) (Branch), 293
addNamespace( ) (XPath, 273
Adobe Flash (see Flash)
AElfred2 (SAX parser), 84
afterMarshal( ) (Listener), 346
afterUnmarshal( ) (Listener), 346
aggregators, 384
building, 365-369
Ajax, 401-415
online sources for information, 414
posting XML to the server, 411-415
creating XML document in JavaScript, 411
servlet to accept XML posts, 413
submitting XML document, 412-413
using DOM with, 406-409
using XSLT with, 408
XMLHttpRequest object, 402-407
allocate( ) method, 238
AndFilter class, 276
annotations, 315, 330-334
class-level, 330-332
XmlAccessorType, 331
XmlRootElement, 331
XmlType, 332
enabling binding of arbitrary Java classes, 316
annotations (continued)
field-level, 332
XmlAttribute, 333
XmlElement, 332
metadata to marshall/unmarshall Java objects, 315
package-level, 333
XmlSchema, 333
POJO generated by xjc in JAXB 2.0, 329
schema generation, 334
XML Schema, 29
Ant task (schema compiler), 323
Apache Struts, 385
Apache Xerces project (see Xerces)
Apple Computer, iTunes RSS module, 355
Apple iPhoto Photocast module, 370
apply-templates construct, 16
arity, 187
arrays, iterating through, 59
asXML( ) (Node), 295
asynchronous parsing, 145
asynchronous transfer of data between browser and web server, 401
asynchronous use of XMLHttpRequest object, 404
Atom Publishing Protocol, 355
Atom Syndication Format, 355
building an aggregator, 365-369
feed created with ROME, 364
feeds, 384
ROME data model, 356
AtomPub Working Group, 355
ATTLIST keyword, 23
Attr interface (DOM), 94, 180
Attribute class (JDOM), 243, 255
ATTRIBUTE event, 208
corresponding StAX interface, 212
XMLStreamReader methods, 202
Attribute interface, 212, 289, 294
attributes, 2, 6, 255
associating namespace URIs their prefixes, 231
declarations handling with DeclHandler, 82
defined in DTD, 23
defined in RELAX NG, 35
defined in XML Schema, 28
dom4j, names of, 294
ElementEditVAL interface methods for, 152
namespace-qualified, accessing in dom4j, 298
passthrough, setting for TransformerFactory, 166
RSS 2.0 enclosure element, 371
used in namespace declarations, 437
using for property values instead of element content, 268
when to use, 6
XmlAttribute annotation, 333
Attributes interface, 56
attributes( ) method, 298
Attributes2 interface, 83, 438
B[ Top ]
BeanDocumentFactory class, 309
beforeMarshal( ) (Listener), 346
beforeUnmarshal( ) (Listener), 346
bgm.ser file, 328
binary formats, converting XML data to, 12
binding
frameworks other than JAXB, 347
between XML document and tree of Java objects, 310
(see also JAXB)
binding declarations, 342-346
web site information, 346
blogs, 349
accepting comments using CommentAPI, 354
Atom Publishing Protocol to create or edit entries, 355
BOOLEAN (XPath return type), 178
Boolean properties of XMLInputFactory, 236
bootstrapping a DOM implementation, 128
Branch interface, 289
addElement( ) method, 293
methods for getting child nodes, 298
browsers
asynchronous transfer of data with web server, 401
creating DOM Document objects, 411
Flash plug-in for displaying SWF files, 415
transformation support, 408
XMLHttpRequest object, 402
C[ Top ]
callback model (SAX), 41
callbacks
asynchronous use of XMLHttpRequest object, 404
JAXP, 346
class-defined, 346
external listener, 346
Marshaller and Unmarshaller interfaces, 316
parser, 49
SAX handlers, 49
SAX parser, 51-64
beginning/end of document, 51
document locator, 51
element, 55-58
element data, 58
ignorable whitespace, 62
namespace, 53
processing instructions (PIs), 52
registering content handler, 63
canAppendChild( ) method, 152
canInsertBefore( ) method, 152
canRemoveAttribute( ) method, 152
canReplaceChild( ) method, 152
canSetAttribute( ) method, 152
cardinality, indicating in RELAX NG, 35
Cascading Style Sheets (see CSS)
case-sensitivity in XML element names, 5
Castor binding framework, 347
categories, iTunes podcast directory, 375
Category class, 375
category element, 375
CDATA awareness, DOM parser factory, 164
CDATA block, HTML markup in RSS 2.0 description element, 352
CDATA class (JDOM), 243
CDATA event, 208
corresponding StAX interface, 212
XMLStreamReader methods, 202
CDATA interface, 294
CDATA nodes, 106
CDATA sections, 9
processing with LexicalHandler, 81
Channel class, 359, 369
module-related methods, 370
channels (RSS), 349
CharacterData interface, 289
CharacterDataEditVAL interface, 148
methods for text, 152
CHARACTERS event, 208
corresponding StAX interface, 212
XMLStreamReader methods, 202
Characters interface, 212
characters( ) method, 42, 55, 58
sequencing mixups, 59
whitespace reported by, 60
child elements, 59
child nodes
methods for getting in dom4j, 298
selecting without knowing their structure, 132
choice attribute (XML Schema), 29
choice operator, 36
class-defined JAXP callbacks, 346
classes
Java, generating from or to a schema, 313
JAXB-generated, validation against schema constraints, 315
JDOM, 243
subclassing, 245
useful return values of setter methods, 245
SAX, 43
class-level annotations, 330-332
XMLType, 332
class-level metadata, document-to-object mapping, 312
classpath, Xerces parser, 43
client-side transformations, 393-395
closing XML tags
consolidating with opening tag in one element, 6
space before end slash, 6
collections, Java, 243
command line, performing XSL transformations from, 18
command-line schema compiler (see xjc application)
Comment class, 262
COMMENT event, 211
corresponding StAX interface, 212
XMLStreamReader methods, 202
Comment interface, 212, 294
adding Comment objects to dom4j Document, 293
CommentAPI module (RSS), 354
comments
comment processing option, DOM parser factory, 164
handling in DOM, 106
processing with LexicalHandler, 81
compiling a schema, 313, 323-330
customizing, 342-346
with xjc, 324
JAXB 1.0 output, 326
JAXB 2.0 output, 326, 329
target namespace for schema, 325
complexType tag, 28
complextype.xsl file (DTD3XS), 31
constants
comparisons based on, 151
Java, representing returns from XPath expression evaluation, 177
representing schemas, 191
constraining XML
with DTDs, 21-24
with RELAX NG, 34-37
with XML Schema, 27-30
constraint model, 20
representing in Java, 192
content handlers (SAX), 62-64
Content interface, 252
content model, 22
Content module (RSS), 354, 370
content syndication (see RSS)
content( ) method, 298
content, XML documents, 2
ContentFilter class, 275
ContentHandler interface, 42, 49, 160
implemented by DefaultHandler class, 79
implemented by ValidatorHandler, 193
startDocument( ) and
endDocument( ), 51
use in dom4j, 292
context path, 322
controller (MVC applications), 385
XML used for data passed to/from view, 385
CopyFrom interface, 380
copyrights, entity references for, 9
crawler, 130
createAttribute( ) method, 289
createCompactFormat( ) (OutputFormat), 295
createDocument( ) method, 308
createElement( ) method, 289, 293, 308
createFilteredReader( ) method, 225
createLSParser( ) (DOMImplementationLS), 145
createNodeIterator( ) method, 133
createPattern( ) method, 289, 306
createPrettyPrint( ) (OutputFormat), 295
createWireFeed( ) (SyncFeed), 360
createXMLEventReader( ) method, 200
createXMLEventWriter( ) method, 227, 233
createXMLRepresentation( ) method, 251
createXMLStreamReader( ) method, 200
createXMLStreamWriter( ) method, 227
createXPath( ) method, 289
createXPathFilter( ) method, 289
Creative Commons module, 370
cross-domain policy files (Flash) (see crossdomain.xml files)
crossdomain.xml files, 429
CSS (Cascading Style Sheets), 19
DOM CSS module, 125
DOM Level 2 Styles module, 92
DOM Style module, 140
cursor API (StAX), 196
XMLStreamReader, 200-211
D[ Top ]
data binding, 310-347
document-to-object mapping in class-level metadata, 312
JAXB
introduction to, 314-322
using, 321-347
schemas and, 312
when to use, 313
data binding (see JAXB)
data element (RELAX NG), 36
data, XML processing instructions, 3
DataGrid control, 421
datatypes
elements defined in XML Schema, 28
base types, extending, 30
simple types, 29
RELAX NG, 34, 36
DataWriter class, 88
methods to output XML, 90
date element (Dublin Core), 369
DCMI (DublinCore Metadata Initiative), 353
declarations
binding, 342-346
listed, 344
web site information, 346
explicit namespace, 54
notation, 78
unparsed entity, 78
DeclHandler interface, 82
DefaultAttribute class, 289
DefaultElement class, 289
DefaultHandler class, 78, 160
DefaultJDOMFactory class, 279
deleteContents( ) method, 136
description element, 17
RSS 1.0 and 2.0, 354
RSS 2.0, 352
detach( ) method, 286
DeveloperWorks XML article template (IBM), 27
disable-output-escaping attribute, 17
DOCTYPE declaration, 3
verifying for xmllint in XML document, 27
Document class, 243, 293
getContent( ) method, 274
getRootElement( ) method, 265
Document interface, 308
DOM, 94, 97
additional methods in Level 3, 102
traversal, 129
dom4j
creating Document object, 293
methods for getting child nodes, 298
Document object (DOM), 98
ROME feed output as, 360
Document Object Model (see DOM)
document object model for Java (see dom4j)
DocumentBuilderFactory class, 163
configuration options, 164
Schema object associated with, 194
setValidating( ), 189
DocumentEditVAL interface, 148, 152
setContinuousValidityChecking( ), 150
DocumentFactory class, 289, 292
DocumentHandler interface, 160
DocumentHelper class, 293
parseText( ) method, 292
DocumentRange interface, 135
DocumentResult class, 305
DocumentSource class, 305
DocumentTraversal interface, 129
DocumentType nodes, 108
DocumentView interface, 139
DOM (Document Object Model), 91-124
Attr object, 180
creating a tree, 114-117
creating Document objects in browsers, 411
JDOM versus, 283
classes and factories, 244
collections support, 243
language bindings, 91
Level 1, 91
Level 2, 92
Events module, 92
HTML module, 93
modules, 92
Styles module, 92
Traversal and Range module, 93
Level 2 Core, 94
Level 3, 93
Load and Save module, 93
Validation module, 93
lists, 95
LSResourceResolver object, 191
modifying a tree, 117-120
modules, 125-153
checking for support, 125-128
Level 2, 129-143
Level 3, 143-153
namespaces, 121-124
Node interface, output from JAXB marshalling, 335
NodeList object, 180
parsing process, 156
returning DOM objects from XPathFactory instance, 178
serialization, 96-110
situations requiring use of, 96
transformations in browsers, 408
traversing a tree, 120
tree model, 94
using in JavaScript, 411
using with Ajax, 406-409
using with JAXP, 162-165
DOM node property (SAX 2.0), 440
dom4j, 176, 288-309
core interfaces, 288-290
distribution, 291
document traversal, 297-305
Visitor Pattern, 303-305
XPath, 299-302
factories, special-purpose, 308
object-oriented transformation API, 291
reading and writing with, 291-297
creating a Document object, 293
document output, 295-297
parser, 292
parsing a document, 292
transformations, 305-307
rule-based, 305
web site, 288
XPath support, 290
DOMBuilder class, 246, 277
setFactory( ) method, 280
DOMConfiguration interface, 145
options, online documentation, 146
setParameter( ) method, 147
DOMDocumentFactory class, 308
DOMImplementation class, hasFeature( ) method, 126-128
DOMImplementationLS class, 145
DOMImplementationRegistry class, 128, 143
specifying for parser, 146
DOMOutputter class, 246
DOMReader class, 293
DOMResult class, 172
DOMSerializer class, 246
DOMSource class, 170
DOMWriter class, 297
.dtd file extension, 26
DTD event, 211
corresponding StAX interface, 212
XMLStreamReader methods, 202
DTD interface, 212
DTD2XS tool, 31
dtd2xsd class, 32
DTDHandler interface, 78, 160
implemented by DefaultHandler class, 79
methods returning absolute paths, 437
DTDs, 3, 20, 21-27
attributes, 23
constraints set by, 5
converting to RELAX NG schemas, 38
elements, 22
entities, 23
generating from XML instance documents, 25
generating XML Schemas from, 31
handling start/end of reference or declaration, 80
JAXP validation and, 191
referenced for Xerces parser, 48
RSS 0.91 DTD (example), 24
validating XML against, 26
for XSL and XSLT, 13
Dublin Core module, 353, 369
dw namespace, 27
E[ Top ]
E4X (ECMAScript for XML), 420
in Firefox, 421
Element class, 243
getChild( ) method, 254, 284
getChildren( ) method, 265
getContent( ) method, 268, 274
methods dealing with NullPointerException case, 285
setAttribute( ) method, 256
subclassing, 278
Element interface, 94, 289, 308
adding Element object to dom4j Document, 293
dom4j, 294
methods for getting child nodes, 298
ELEMENT keyword, 22
ElementEditVAL interface, 148
methods for attributes, 152
ElementFilter class, 275
elementIterator( ) method, 299
elements, 2, 4-6, 255
closing tags, 5
consolidating opening and closing XML tags in one element, 6
content model, 22
declarations, handling with DeclHandler, 82
defined in DTD, 22
defined in RELAX NG, 34
defined in XML Schema, 28
dom4j, names of, 294
Dublin Core, 353
JAXBElement class, 338
namespace, 7
namespace-qualified, accessing in dom4j, 298
naming, 4
resulting from properties, 312
RSS 2.0, 352
RSS Syndication module, 354
RSS, defined by iTunes module, 373
SAX callbacks for, 55-58
element data, 58
when to use (instead of an attribute), 6
XmlElement annotation, 332
XSL, distinguishing from other elements with namespaces, 16
EMPTY keyword, 23
empty XML elements, 230
encapsulation, using InputSource for, 48
Enclosure class, 371
enclosure RSS 2.0 element, 371
END_DOCUMENT event, 206
corresponding StAX interface, 212
XMLStreamReader methods, 202
END_ELEMENT event, 206
corresponding StAX interface, 212
XMLStreamReader methods, 202
EndDocument interface, 212
endDocument( ) (ContentHandler), 52
EndElement interface, 212
ending points (ranges), 136
ending XML element tags, 5
endPrefixMapping( ) method, 54
entities, 23
declarations
handling with DeclHandler, 82
handling with LexicalHandler, 80
external general entity processing, 435
external parameter entity processing, 436
handling by XMLStreamWriter, 229
parameter entity reporting, 436
resolving with SAX, 73-77
SAX parser handling of, 62
start/end methods for reference processing, 81
unparsed, 78
Entity interface, 294
ENTITY keyword, 23
entity references, 8
defined by users, 9
expanding, 277
DOM parser factory, 164
HTML content in XML document, 17
quotation marks within attribute values, 256
ENTITY_DECLARATION event
corresponding StAX interface, 212
XMLStreamReader methods, 202
ENTITY_REFERENCE event
corresponding StAX interface, 212
XMLStreamReader methods, 202
EntityDeclaration interface, 212
EntityRef class, 276
EntityReference interface, 212
EntityResolver interface, 74, 160, 169
implemented by DefaultHandler class, 79
using different implementations for different applications, 77
using separate source file for implementations, 77
EntityResolver2 interface, 83, 438
Entry class, 369
module-related methods, 370
EntryInformation interface, 373
EntryInformationImpl class, 374
enumeration feature (XML Schema), 30
equals( ) (Namespace), 270, 304
error handlers (SAX), 64-69
fatal errors, 67
nonfatal errors, 67
testing by generating problems, 68
warnings, 66
error handling
SAX features and properties, 72
setting with DOMConfiguration, 145
ErrorHandler interface, 64, 160, 168
implemented by DefaultHandler class, 79
providing implementation for ValidatorHandler, 194
setting on Validator, 193
ErrorListener interface, 166
setting option for transformations, 168
errors
capturing nonfatal errors in StAX XML parsing, 237
common, with StAX, 239
reporting in processing XML schema, 191
escaping characters
avoiding with use of CDATA section, 9
entity references, using, 8
HTML content in XML elements, 17
evaluate( ) (XPath), 179
event iterator API (StAX), 196
XMLEventReader, 211-218
event-based programming (SAX), 41
EventFilter interface, 224
events
adding to XMLEventWriter, 233
JAXB validation, 341
normal flow in SAX parsing, 84
SAX, access by ValidatorHandler, 194
StAX, 197
correlation with SAX handler methods, 198
URLLoader, 423
XMLEventAllocator interface, 238
XMLSocket, 426
Events module (DOM), 92, 125, 137
explicit namespace declaration, 54
Extensible Stylesheet Language (see XSL)
Extensible Stylesheet Transformations (see XSLT)
extension keyword, 30
external binding declaration, 343
external general entities, processing, 435
external listener (JAXP) callbacks, 346
external parameter entities, processing, 436
externalEntityDecl( ) method
DeclHandler interface, 82
DTDHandler interface, 437
extractContents( ) method, 137
F[ Top ]
factories
dom4j
core, 289
special-purpose, 308
JDOM and, 244, 278-283
creating a factory, 279
Fast Infoset, 432
fatal errors, SAX handling of, 67
features
core features, SAX 2.0, 435-439
dom4j, 290
parser factory passthrough features option, 159
requesting support in DOM Level 3, 128
SAX parser, 236
error handling, 72
handlers versus, 79
setting, 71
URIs, resolving, 72
TransformerFactory option, 166
Feed class, 359, 369
module-related methods, 370
FeedInformation interface, 373
containing multiple Category objects, 375
getOwnerEmailAddress( ), 377
FeedInformationImpl class, 373
field-level annotations, 332
XmlAttribute, 333
XmlElement, 332
File object, ROME feed output as, 360
Filter interface, 274
match( ) method, 275
filters
Java servlet filter, transforming XML, 395-399
JDOM, 274-276
SAX, 84-90
chaining, 88
XMLWriter, 88
StAX, 224-227
Firefox
E4X in, 421
transformations in, 410
Flash, 415-430
ActionScript, 415
components, 415
cross-domain access, 429
Flex, 416
XML in ActionScript 3.0, 417-429
E4X, 420
Flash XML sockets, 423-426
sending and loading XML, 421
XML data providers, 421
Flash Player, 415
Flex, 416
Flex 2 and ActionScript 3.0, 417-429
flush( ) (XMLStreamWriter), 231
for-each construct, 16
form components created in MXML, 418-420
form data, submitting as XML, 412
Format class, 247
getCompactFormat( ) method, 257
getPrettyFormat( ) method, 257
getRawFormat( ) method, 257
properties for Format customization, 257
format-independent data model (ROME), 356
formatting, 11
XML objects written in dom4j
customized formatting, 296
default options, 295
formatting objects, 11
functions
XPath, 186-189
XPath node sets, 14
G[ Top ]
generics, 315
GeoRSS module, 370
getAttributes( ) method (Node), 105
getAttributeValue( ) method, 268
getChild( ) (Element), 254, 284
getChildNodes( ) method, 104
getChildren( ) method, 299
Element class, 265
Node interface, 95
getChildText( ) (Element), 285
getChildTextNormalize( ) (Element), 285
getChildTextTrim( ) (Element), 285
getColumnNumber( ) (Locator), 51
getCompactFormat( ) (Format), 257
getContent( ) method, 268
Document class, 274
Element class, 274
Parent interface, 274
getData( ) (Element), 309
getDescendants( ) (Parent), 274
getDocument( ) (DOMParser), 98
getDocumentElement( ) method, 102
getDOMImplementation( ) method, 128, 145
getElementsByTagName( ) method, 120, 406
getElementsByTagNameNS( ) method, 299
getElementText( ) (XMLEventReader), 211
getEventType( ) (XMLEvent), 213
getException( ) (SAXException), 52
getFeature( ) method
checking for extension interface support, 83
XMLReader interface, 71
getFirstChild( ) method, 121
getLineNumber( ) (Locator), 51
getLocalName( ) method, 56
getLocation( ) method, 223
getNamespace( ) method (Namespace), 270
getNamespaces( ) method, 382
getNamespaceURI( ) method, 207
getNode( ) (Marshaller), 336
getNodeName( ) method, 133
getNodeType( ) (Node), 101
getOwnerEmailAddress( ) (FeedInformation), 377
getParent( ) (Node), 95
getPrettyFormat( ) (Format), 257
getProperty( ) method, 235, 251
Marshaller interface, 337
XMLReader interface, 71
getRawFormat( ) (Format), 257
getRootElement( ) (Document), 265
getSchema( ) method, 321
getSupportedFeedTypes( ) method, 360
getTextNormalize( ) method, 265
getURI( ) method, 56
getXMLReader( ) method, 162
GNU JAXP project, 84
Google Base module, 370
Google search engine, 130
grammar element (RELAX NG), 34
H[ Top ]
HandlerBase class, 160
handlers
DefaultHandler class, 78
features versus, 79
SAX, 49
hasFeature() (DOMImplementation),
126-128, 145
Hashtable class, 248
hasNext( ) method, 206
XMLStreamReader interface, 201
header, XML documents, 2
HTML
DOM modules related to, 128
embedding in RSS 1.0 with Content module, 354
escaped content in XML document, 17
in RSS 2.0 description element, 352
transforming XML to, using JSP, 391-393
XHTML, 6
HTML documents, well-formed XML and, 5
HTML module (DOM), 93, 126, 141
HTMLAnchorElement interface, 141
HTMLDocument interface, 141
HTMLFormElement class, setAction( ), 141
HTMLSelectElement interface, 141
HTMLWriter class, 297
HTTP POST method, 411
I[ Top ]
I/O streams as input to parsers, 48
ICBM RSS module, 379
ICBMGenerator class, 383
ICBMModule interface, 380
ICBMModuleImpl class, 381
ICBMParser class, 383
identity transformation, 173
IE (see Internet Explorer)
IETF (Internet Engineering Task Force), AtomPub Working Group, 355
ignorable whitespace, dropping with DocumentBuilder, 165
ignorableWhitespace( ) method, 60, 62
index-based access to child elements in dom4j, 299
IndexedDocumentFactory class, 289, 309
IndexedElement class, 289
Informa library, 383
inline binding declarations, 342
innerHTML property, 406
input and output
document output in dom4j, 295-297
feed input with ROME, 365
input for read( ) method, SAXReader, 292
input for XML, 147
input options for unmarshal( ), 338
JAXB marshalling, output mechanisms, 335
JDOM, 245
outputting a ROME feed, 360
outputting XML with JDOM, 256-259
RSS podcast feed, using iTunes module with, 377
InputSource class, 47
advantages over URI use, 48
InputStream class, 200
instance documents, 20
generating DTDs from, 25
generating RELAX NG schema from, 37
generating XML Schemas from, 30
validating against an XML Schema, 33
interfaces
DOM, 94
HTML, 141
dom4j core interfaces, 288-290
JAXB validation events, 341
ROME module, 370, 379
SAX, 42
extension, 79-84
handlers, 49
intern( ) (String), 437
internalEntityDecl( ) (DeclHandler), 82
Internet Engineering Task Force (IETF), AtomPubWorking Group, 355
Internet Explorer (IE)
transformation support, 408
XMLHttpRequest object in Version 7, 403
XMLHttpRequest object in versions prior to 7, 402
invalid XML created in JDOM subclassing, 286
IOException class, 47
iPhoto Photocast module, 370
isPropertySupported( ) method, 236
isRepairingNamespaces property, XMLOutputFactory, 238
isValidating( ) (Unmarshaller), 339
Item class, 369
module-related methods, 370
items (RSS), 349
comments, 354
Iterator interface, 200
adding attribute and namespace objects, 234
using in dom4j, 299
iTunes interface, 373
iTunes module, 355, 370
creating podcast RSS feed, 371-377
iTunes Music Store, 355
podcast directory, 372
J[ Top ]
Java
for each loop, 16
Simple API for XML (see SAX)
varargs language features (Java 5), 322
web MVC frameworks, 385
Java API for XML Processing (see JAXP)
Java Architecture for XML Binding (see JAXB)
Java Community Process (JCP), 314
Java Enterprise Edition 5, JAXB 2.0, 315
Java Language Bindings, 152
Java servlets (see servlets)
Java Specification Recommendation (JSR) 173 (StAX), 196
Java Specification Requests (JSR) JAXB, 314
Java Standard Tag Library (JSTL)
server-side XML transformations using XSLT, 400-401
XML tags, 391
Java WSDP, 198, 317
components in Version 2.0, 317
downloading and installing, 317-319
JavaBean objects, 309
JavaScript
client-side transformation of XML document to HTML, 394
creating XML document, 411
DOM document access in, 407
use of XMLHttpRequest object, 402
using DOM capabilities, 411
JavaServer Pages (see JSPs)
javax.xml.bind package, 321
javax.xml.parsers package, 156
javax.xml.stream package, 197
javax.xml.stream.events package, 212
javax.xml.validation package, 189
JAXB (Java Architecture for XML Binding), 310-347
data binding basics, 310-314
schemas and, 312
when to use data binding, 313
JAXB 1.0, 314
JAXB 2.0, 315
added features, 315
reference implementations, 317-322
downloading JAXB 2.0 reference implementation, 319-322
Java WSDP, 317-319
Specification Requests and web sites, 314
using, 321-347
annotations, 330-334
callbacks, 346
compiling a schema, 323-330
core JAXB 1.0 API, 321
JAXBContext class, 322
marshalling, 334-337
schema compilation customization, 342-346
unmarshalling, 337-339
validation, 339-342
jaxb.properties and bgm.ser files, 328
JAXBContext class, 321, 322
newInstance( ) method, 322
JAXBElement class, 338
Jaxen library, 271
JAXP (Java API for XML Processing), 154-195
parsing XML, 156-165
changing parser implementation, 165
reading XML with SAX, 156-165
using DOM, 162-165
processing XSL, 165-176
basic transformations, 166-173
caching transformation instructions, 174
changing processor implementation, 176
identity transformation, 173
validation, 189-195
creating SchemaFactory, 189-191
problems with, 195
representing constraint model, 192
validating XML, 192-195
Xerces version used with, 94
XML parsing and validation, 154
XPath API, 155, 176-189
creating instance of XPath interface, 178
document for XPath examples, 178-180
functions, 186-189
JDOM XPath versus, 274
namespaces, 181-183
variables, 183-186
XSL processing, 155
jaxp.properties file, modifying, 165
JCP (Java Community Process), 314
JDOM, 176, 243-287
common issues with, 283-287
creating invalid XML, 286
JDOM isn't DOM, 283
nodes have one parent, 285
null return values, 284
subclassing, 286
concrete classes and factories, 244
distribution, obtaining, 247
EntityRef class, 276
factories and, 278-283
building with custom classes, 280-282
creating a factory, 279
UncheckedJDOMFactory, 283
filters, 274-276
ContentFilter, 275
ElementFilter, 275
NegateFilter, 276
OrFilter and AndFilter, 276
input and output, 245
Java collections support, 243
Namespace class, 269
PropsToXML class, 248-259
creating XML, 251-256
outputting XML, 256-259
tree representation of XML document, 243
useful return values from class setter methods, 245
XMLProperties class, 259-269
loading XML, 263-265
problems with test output, 267-269
storing XML, 261-263
testing, 265
XPath, 271-274
XPathFactory instance that uses, 178
XSLTransformer class, 270
JDOMFactory interface, 245, 279
custom implementation, 280
JDOMResult class, 271
JDOMSource class, 271
JRE (Java Runtime Environment), modifying jaxp.properties, 165
JSPs (JavaServer Pages)
in MVC web application, 385
rendering XML with JSP tags, 390
transforming XML to HTML, 391-393
JSTL XML tags, 391
JSR (Java Specification Recommendation) 173 (StAX), 196
JSR (Java Specification Requests), JAXB, 314
JSTL (Java Standard Tag Library)
server-side XML transformations using XSLT, 400-401
XML tags, 391
JTidy, 128
XML pretty printing, 230
JTreeHandler class, 54
JWSDP (see Java WSDP)
L[ Top ]
language bindings (DOM), 91
leaves and nodes (node set), 14
Level 1 DOM, 91
Level 2 Core DOM, 92, 94
Level 2 DOM, 92
modules, 129-143
Events, 137
HTML, 141
Range, 135-137
Style, 140
Traversal, 129-135
Views, 139
Level 3 DOM, 93
modules, 143-153
Load and Save, 143-148
Validation, 148-153
LexicalHandler interface, 80, 436, 441
List class iterating over elements in dom4j, 299
Listener class, 346
lists, DOM, 95
Load and Save module (DOM), 93, 96, 143-148
Load and Save module (see LS module)
load( ) method, 248, 259, 264
loadFromElements( ) method, 264
local name
dom4j elements and attributes, 294
elements, 53, 56
Location interface, 223
Locator class, 51
Locator2 interface, 83, 438
looping XSL, 16
LS (Load and Save) module, 126, 143-148
LSInput object, 147
LSParser class, 146
LSResourceResolver object, 191
setting on Validator, 193
M[ Top ]
Macromedia Flash (see Flash)
markup languages, 10
marshal( ) methods, output mechanisms accepted, 335
Marshaller interface, 321
callback methods, 316
getNode( ) method, 336
JAXB 2.0 integration with StAX, 316
properties, 337
setEventHandler( ) method, 341
setSchema( ) and getSchema( ), 321
setSchema( ) method, 340
marshallers, 310
marshalling, 310, 334-337
bidirectional DOM support, 336
schema validation during, 340
match attribute, 15
match( ) (Filter), 275
MediaRSS module, 370
Megginson, David, 88
metadata
class-level, for document-to-object binding, 312
Dublin Core Metadata Initiative, 353
META-INF/services file, 199
mixed attribute (elements in XML Schema), 29
model (MVC applications), 385
Model-View-Controller (see MVC pattern)
Module interface, 370, 380
ModuleGenerator class, 382
ModuleImpl class, 370
ModuleParser interface, 381
modules (DOM)
checking for support, 125-128
module names, 125
Level 2, 92, 129-143
Events, 137
HTML, 141
Range, 135-137
Style, 140
Traversal, 129-135
Views, 139
Level 3, 93, 143-153
Load and Save, 143-148
Validation, 148-153
requesting support in DOM Level 3, 128
modules (ROME), 369
creating, 377-383
modules (RSS), 352-355
CommentAPI, 354
Content module, 354
Dublin Core, 353
iTunes, 355
Syndication module, 354
MP3 file for RSS podcast feed, 372
MVC (Model-View-Controller) pattern, 384-391
Java web MVC frameworks, 385
MXML (Flex XML file format), 416
form components in, 418-420
full source code for example application, 426-429
My Yahoo!, 384
N[ Top ]
NamedNodeMap class, 95, 105
names
attributes, 6
XML elements, 4
XML elements and attributes, 56
Namespace class, 269
dom4j, 294
equals( ) method, 270
NAMESPACE event, 208, 212
XMLStreamReader methods, 202
Namespace interface, 294
NamespaceChangingVisitor class, 304
NamespaceContext interface, 177, 182-183, 232
namespaces, 7, 278
accessing namespace-qualified element or attribute in dom4j, 298
awareness, setting for SAX, 70
declarations in XML Schema, 27
distinguishing XSL from other types of elements, 16
DOM support for, 121-124
in dom4j, 294
Dublin Core Simple elements, 353
in instance documents validated against XML Schema, 33
JAXB 1.0 support of, 315
JDOM Namespace objects, 382
not used in instance document validated against XML Schema, 33
parser factory namespace awareness, 158
prefix reporting, 437
processing in XmlPull, 242
RELAX NG, 34
replacing URIs
data snapshot using XMLWriter, 89
using filters, 85-88
reporting on xmlns attributes, 439
ROME module, 379
RSS 1.0 and 2.0, 351
RSS 1.0 Content module, 354
RSS 1.0 Syndication module, 354
RSS CommentAPI module, 355
RSS iTunes module, 355
RSS iTunes module elements, 373
SAX 2.0 namespace processing, 436
SAX parser callbacks, 53
support by JDOM XPath class, 273
support by XMLStreamWriter, 231
target namespace for schema compiled with xjc, 325
XMLOutputFactory property, 238
XPath, 181-183
NegateFilter class, 276
nested elements, applying templates in XSL, 16
nested XML tags, 5
new keyword
instantiating JDOM classes, 244
instantiation of XMLHttpRequest object, 403
newInstance( ) method
JAXBContext class, 322
XMLInputFactory class, 199
XMLOutputFactory class, 227
XPathFactory class, 178
newSchema( ) method, 192
NewsGator, 384
newTransformer( ) method, 169
newValidator( ) method, 192
newValidatorHandler( ) (Schema), 194
next( ) method, 206
nextTag( ) method, 218-220
NODE (XPath return type), 178, 180
Node interface, 94
accessing child nodes, 104
DOM output from marshalling, 335
dom4j, 288
asXML( ) method, 295
Visitor Pattern, 290
getAttributes( ), 105
node sets, 14
functions for, 14
node( ) method, 299
nodeCount( ) method, 299
NodeEditVAL interface, 148
nodeValidity( ) method, 153
NodeFilter interface, 130, 132
acceptNode( ) method, 132
NodeIterator interface, 130, 132
NodeList class, 95, 180
nodes, 162
adding to Document object in dom4j, 293
DOM node property, SAX 2.0, 440
JDOM, single parent of, 285
nodes (continued)
types supporting validation, 148
working with, 101
XML, eliminating references from code, 310
NODESET (XPath return type), 178
NodeTypePattern class, 306
nodeValidity( ) method, 153
noNamespaceSchemaLocation attribute, 33
nonfatal errors in XML parsing, 237
SAX handling of, 67
normalization (Unicode), 438
normalizing character data in XML document, 257
notation declarations, handling with DTDHandler, 78
NOTATION_DECLARATION event
corresponding StAX interface, 212
XMLStreamReader methods, 202
notationDecl( ) (DTDDHandler), 437
NotationDeclaration interface, 212
null return values (JDOM), 284
NullPointerExceptions, 284
NUMBER (XPath return type), 178
O[ Top ]
Object class
Object properties of XMLInputFactory, 237
SAX features and properties and StAX properties set to, 236
object model neutral, 176
ObjectFactory class, 328
generated in JAXB 2.0, 329
objects
plain-old Java objects (see POJOs)
tree of Java objects, binding to XML document, 310
Odeo.com, 372
oneOrMore element, 35
opening XML tag, consolidating with closing tag in one element, 6
optional element, 35
order
elements defined in XML Schema, 29
of nested XML tags, 5
OrFilter class, 276
org.dom4j.tree package, 289
org.xml.sax.driver system property, 45
output escaping, HTML content in XML elements, 17
output( ) method, 258
OutputFormat class
customized formatting, 296
default formatting, 295
P[ Top ]
package-level annotations, 333
XmlSchema, 333
parameter entity reporting, 436
parameterized types (generics), 315
parent elements, 59
Parent interface, 274
parse( ) method, 381
DomParser class, 98
XMLReader interface, 45
parser factory
configuring, 158
creating, 158
parsers
changing implementation in JAXP, 165
checking for DOM module support, 125-128
DOM Level 3 support, 93
dom4j, provided by another package, 292
I/O streams as input, 48
JTidy, 128
obtaining a parser, 160
Xerces, 43
parseText( ) (DocumentHelper), 292
parsing, 41
dom4j, 292
JAXP, 154, 156-165
reading XML with SAX, 156-165
pull parsing with StAX, 196-242
cursor and event iterator APIs, 196
download site for StAX, 197
factory classes, 199
obtaining StAX, 198
parsing, 199-227
StAX event types, 197
pull parsing with XmlPull, 239-242
SAX, 45-49
event flow, 84
instantiating a reader, 45-47
parsing the document, 47-49
warnings and nonfatal errors, capturing, 237
passthrough attributes option, TransformerFactory, 166
passthrough features, configuring for parser factory, 159
Pattern interface, 305
#PCDATA keyword, 23
peek( ) (XMLEventReader), 224
Pilgrim, Mark, 350
pipeline (SAX), 84
chaining filters, 88
outputting data snapshot with XMLWriter, 89
PIs (see processing instructions)
plain-old Java objects (see POJOs)
Podcast Alley, 372
podcast directories, 372
iTunes, categories, 375
podcasting, 349
creating a podcast RSS feed, 371-377
podcasts listed within iTunes directory, 355
point type, defined in RELAX NG, 36
POJOs (plain-old Java objects), 315
annotated POJO generated in JAXB 2.0, 329
portable runtime, JAXB 2.0, 316
POST method (HTTP), 411
prefix mapping, 53
prefixes, namespace, 7, 437
associating with namespace URIs, 231
dom4j, 294
presentation, XML as, 384-430
Ajax, 401-415
posting XML to the server, 411-415
using DOM with, 406-409
using XSLT with, 408
XMLHttpRequest, 402-407
Flash, 415-430
ActionScript, 415
Flex, 416
XML in ActionScript 3.0, 417-429
MVC pattern, 384-391
XML in MVC web applications, 385-391
transforming to HTML with JSP, 391-393
transforming to HTML with XSLT, 392-401
client-side transformations, 393-395
server-side transformations, 394-401
pretty printing, XML documents, 230, 295
processing chain (see pipeline)
processing instructions (PIs), 3
SAX parser callback for, 52
using in XSL client-side transformation, 393
PROCESSING_INSTRUCTION event
corresponding StAX interface, 212
XMLStreamReader methods, 202
ProcessingInstruction class, 263
ProcessingInstruction interface, 212, 293
processingInstruction( ) method, 53
processors, XSL, 176
properties
core properties, SAX 2.0, 440
core SAX 2.0 properties, 440
formatting properties in JDAM Format class, 257
Java properties files, 248
Marshaller interface, 337
resulting in elements, not attributes, 312
rome.properties file, 383
SAX parser, 236
error handling, 72
setting, 71
URIs, resolving, 72
setting on SAXReader object, 292
StAX, setting on factories, 235-238
Boolean properties of XMLInputFactory, 236
Object properties of XMLInputFactory, 237
XMLOutputFactory, 238
Unmarshaller interface, 339
XMLProperties class, 259-269
Properties class, 248, 259
propertyNames( ) (Properties), 251
PropsToXML class, 248-259
converting properties file to XML, 249-251
creating XML, 251-256
Java properties files, 248
outputting XML with JDOM, 256-259
public IDs
for DTDs, 3
slowing down entity resolution, 76
PUBLIC keyword, 3
pull parsing, 196
Q[ Top ]
Q name (elements), 53, 56
QName class, 177, 212
dom4j, 294, 299
JAXP, 295
qualifications in XML Schema, 28
R[ Top ]
random access to document, 96
Range module (DOM), 93, 135-137
RDF (Resource Description Framework), 349, 353
read( ) (SAXReader), 292
Reader class, 200
Really Simple Syndication (see RSS)
recurrence modifiers (DTD), 22
recurrence, indicating in RELAX NG, 35
RELAX NG, 21, 34-40
constraining XML, 34-37
attributes, 35
cardinality and recurrence, 35
datatypes, 36
elements, 34
converting DTDs to, 38
converting XML Schemas to, 39
generating schema from XML instance, 37
validating XML against, 40
RELAX NG Converter, 38
Relaxer
generating DTDs, 25
generating RELAX NG schema, 37
generating XML Schemas, 30
removeContent( ) method, 274, 286
require( ) (XMLStreamReader), 221-223
resolveEntity( ) method, 75
bogging down with ID resolutions, 76
XMLResolver interface, 237
Resource Description Framework (see RDF)
resource resolution when parsing schemas, 191
restriction keyword, 30
Result interface
implementations, 172
JDOM implementation, 271
support by XMLOutputFactory, 228
validate( ) method input, 193
ROME library, 356-360
creating a feed, 361-364
Atom 1.0 feed, 364
RSS 1.0 feed, 363
RSS 2.0 feed, 362
data models, 356
feed input with, 365
modules, 369
creating, 377-383
iTunes module, creating podcast feed, 371-377
outputting a ROME feed, 360
rome.properties file, 383
root elements, 3
dom4j Document, 293
JDOM Document, 251
RSS 1.0 and 2.0, 351
XML Schema, 27
RSS (Really Simple Syndication), 348-384
Atom, 355
creating an RSS feed, 356-364
ROME library, 356-360
with ROME, 361-364
creating podcast RSS feed, 371-377
creating ROME module, 377-383
modules, 352-355
CommentAPI, 354
Content, 354
Dublin Core, 353
iTunes, 355
Syndication, 354, 369
reading an RSS feed, 365-369
building an aggregator, 365-369
feed input with ROME, 365
ROME library modules, 369
RSS 0.91 DTD example, 24
variants, 349
elements in RSS 2.0, 352
example RSS 1.0 feed, 350
example RSS 2.0 feed, 351
HTML markup in 2.0 description element, 352
Rule objects, 305
run( ) (Action), 306
S[ Top ]
SAX (Simple API for XML), 41-69
API, 42
callbacks and event-based programming, 41
content handlers, 62-64
core features, SAX 2.0, 435-439
core properties, SAX 2.0, 440
DefaultHandler class, 78
entities, resolving, 73-77
error handlers, 64-69
extension interfaces, 79-84
Attributes2, 83
DeclHandler, 82
EntityResolver2, 83
LexicalHandler, 80
Locator2, 83
online documentation, 84
features and properties
error handling, 72
StAX properties versus, 236
filters, 84-90
XMLFilter, 84
XMLWriter, 88
handler methods correlated with StAX events, 198
notations and unparsed entities, 78
parsing process, 156
parsing setup, 43
parsing with, 45-49
instantiating a reader, 45-47
parsing the document, 47-49
properties and features, 70-73
setting, 71
reading XML, 156-165
situations for using DOM instead of SAX, 96
SAXBuilder class, 246, 277
setFactory( ) method, 280
SAXException class, 47, 52, 65
SAXNotRecognizedException, 72, 159
SAXNotSupportedException, 72, 159
Saxon processor, 176
SAXParseException class, 65
SAXParser class, 160
accessing XMLReader directly, 162
SAXParserFactory class, 158
replacing with DocumentBuilderFactory, 163
Schema object associated with, 194
setValidating( ), 189
SAXReader class, 292
SAXSource class, 170
SAXStreamTreeViewer class (example), 202
SAXTreeViewer class, 63
SAXWriter class, 297
Schema class, 321
marshall-time validation of Schema object, 340
schema compiler, 313
Ant task or xjc application, 323
compiling with xjc, 324
JAXB 1.0 output, 326
JAXB 2.0 output, 326, 329
target namespace for schema, 325
JAXB 1.0, 315
JAXB 2.0, generating annotated POJOs, 315
schema generation from annotated classes, 334
Schema object, 158
associating with SAX or DOM factory, 194
creating with newSchema( ), 192
newValidatorHandler( ) method, 194
SchemaFactory class, 189-191
options, 191
schema types, 191
schemagen, 334
schemaLocation attribute, 33
schemas, 20
data binding and, 312, 314
defined, 21
generation in JAXB 2.0, 316
support by JAXB 1.0, 315
types used with SchemaFactory, 191
whitespace and, 60
XmlSchema annotation, 333
select attribute, 16
selectNodes( ) (XPath), 272
selectSingleNode( ) (XPath), 272
send( ) (XMLHttpRequest), 411
sequencing mixups, SAX callbacks for element data, 59
serialization, 93, 96-110
using identity transformation, 173
server-side transformations, 394-401
servlets
building servlet to accept XML posts, 413
example servlet generating XML document, 385-389
simpler book list servlet, 389
filter, transforming XML in, 395-399
in MVC web application, 385
setAction( ) (HTMLFormElement), 141
setAttribute( ) method, 255
setContentHandler( ) method, 63
XMLReader class, 49
setContinuousValidityChecking( ) (DocumentEditVAL), 150
setData( ) method, 121
setDocumentLocator( ) (ContentHandler), 51
setDTDHandler( ) (XMLReader), 49, 78
setEntityResolver( ) method, 74
XMLReader class, 49
setErrorHandler( ) (XMLReader), 49
setErrorHandler( ) method, 189
setErrorListener( ) method, 168
setEventHandler( ) method, 341
setExpandEntities( ) method, 277
setFactory( ) method, 280
setFeature( ) (XMLReader), 71
setFeedType( ) (SyndFeed), 360
setFeedType( ) method (SyndFeed), 360
setParameter( ) (DOMConfiguration), 147
setProperty( ) method, 235
Marshaller interface, 337
registering LexicalHandler with XMLReader, 82
XMLInputFactory class, 200
XMLReader class, 71
setResourceResolver( ) method, 191
setRootElement( ) method, 251
setSchema( ) method, 321, 340
setStartBefore( ) method, 136
setSystemID( ) (InputSource), 48
setText( ) method, 252, 253
setValidating( ) method
DocumentBuilderFactory class, 189
SAXParserFactory class, 189
Unmarshaller interface, 339
setVariable( ) (XPath), 273
sibling elements, accessing, 96
Simple API for XML (see SAX)
SJSXP (Sun Java Streaming XML Parser), 198
skippedEntity( ) method, 62
Slashcode module, 370
SocketException class, 52
sockets, Flash XML, 423-426
source document, views associated with, 139
Source interface, 170
inputs to StAX reader, 200
JDOM implementation, 271
schema file supplied as implementation, 192
validate( ) method input, 193
SPACE event, 209
corresponding StAX interface, 212
XMLStreamReader methods, 202
spaces, not allowed in XML element names, 4
special characters
in CDATA section, 9
entity references for, 8
in XML, handling with print( ) method, 105
spider, 130
Spring MVC, 385
standalone documents, 436
START_DOCUMENT event, 204
corresponding StAX interface, 212
XMLStreamReader methods, 202
START_ELEMENT event, 206, 211
adding attributes and namespace declarations, 234
corresponding StAX interface, 212
XMLStreamReader methods, 202
StartDocument interface, 212
startDocument( ) (ContentHandler), 52
StartElement interface, 212
startElement( ) method, 56
starting and ending points (ranges), 136
startPrefixMapping( ) method, 54
StAX (Streaming API for XML), 196-242
common problems with, 239
cursor and event writer APIs, 196
document output, 227-235
XMLEventWriter, 233-235
XMLStreamWriter, 228-233
download site, 197
event types, 197
factory classes, 199
factory properties, 235-238
Boolean properties, XMLInputFactory, 236
Object properties, XMLInputFactory, 237
XMLOutputFactory, 238
integration with JAXB 2.0, 316
obtaining an implementation, 198
parsing with, 199-227
creating a reader, 200
filters, 224-227
traversal options, 218-224
XMLEventReader, 211-218
XMLStreamReader, 200-211
StAXEventReader class, 293
StAXEventWriter class, 297
store( ) (XMLProperties), 259, 262
StreamFilter interface, 224
Streaming API for XML (see StAX)
StreamResult class, 172
StreamSource class, 170
STRING (XPath return type), 178
String class
intern( ) method, 437
outputting String object from Document object in dom4j, 295
parsing String object as XML, 292
ROME feed output as String object, 360
String parameter for createWireFeed( ), 360
StringReader class, 200, 292
strings
literal XML strings, 441
supported by ROME, 360
used for element in RELAX NG, 36
Style module (DOM), 92, 140
Stylesheet object, 291
stylesheets, 92
sample XSL stylesheet, 306
xml-stylesheet processing instruction, 393
(see also CSS)
Subcategory class, 375
subclassing JDOM classes, 286
creating invalid XML, 286
submitting form data as XML, 412
Sun Java Streaming XML Parser (SJSXP), 198
Sun's RELAX NG Converter, 38
SWF file format, 415
SyndEnclosure interface, 371
SyndEntry interface, 357, 369
module-related methods, 370
SyndFeed interface, 357, 369
module-related methods, 370
setFeedType( ) method, 360
SyndFeedImpl class, 357
SyndFeedInput class, 365
SyndFeedOutput class, 360
syndication (see RSS)
Syndication module (RSS), 354, 369
system ID (XML document), 48
SYSTEM keyword, 3
T[ Top ]
tags
HTML, DOM HTML module, 141
XML, JSTL library, 391
Tapestry, 385
target, XML processing instructions, 3
template keyword, 15
template matching (XSL), 15
Templates object, 174
Transformer versus, when to use, 175
Text class (JDOM), 243
Text interface, 94, 294
Text nodes, 153
textual content of an element, 265
textual data within elements (in SAX), 58
thread safety, Transformer instances and, 174
Tidy, 93
toc.rng schema (example), 37
toc-dtd.rng file (example), 38
transformations, XML, 10-19, 165-176
basic, 166-173
caching transformation instructions, 174
dom4j, 305-307
rule-based, 305
object-oriented API, 291
identity transformation, 173
JAXP transformations API (TrAX), 155
transforming to HTML
using JSP, 391-393
using XSLT, 392-401
using XSLT with Ajax, 408
XPath, 13
XSL, 11
XSLT, 12
XSLTransformer class, 270
Transformer object, when to use versus Templates object, 175
TransformerFactory class, 166-169
setErrorListener( ), 168
transformNode( ) method, 409
Traversal and Range module (DOM), 93, 125
Traversal module (DOM), 129-135
TrAX (Transformations API for XML), 155, 165
use by JDOM, 271
using with dom4j, 305
tree structure
DOM, 94
creating, 114-117
modifying, 117-120
traversing, 120
Java objects, 310
JDOM, 243
XSL data, 11
XSLT data, 13
tree-based parsers, StAX versus, 196
TreeWalker interface, 130, 134
type attribute (XML Schema), 29
U[ Top ]
UML-style model of DOM, 95
unbounded attribute (XML Schema), 29
UncheckedJDOMFactory class, 283
Unicode
normalization checking, 438
XML 1.1 and, 9
unmarshal( ) method (Unmarshaller), input options, 338
Unmarshaller interface, 311, 321
callback methods, 316
JAXB 2.0 integration with StAX, 316
properties, 339
setEventHandler( ) method, 341
setSchema( ) and getSchema( ), 321
setSchema( ) method, 340
turning on/off JAXB validation of input, 339
unmarshal( ) method, input options, 338
unmarshallers, 310
unmarshalling, 310, 337-339
unparsed data (CDATA section), 9
unparsedEntityDecl( ) (DTDHandler), 437
update frequency of RSS feeds, 354
URIResolver interface, 166, 169
URIs
absolute URI declaration resolution, 437
defined, 47
features and properties, resolving, 72
InputSource class versus, 48
namespace, 53
attributes associating URIs with prefixes, 231
combined with local name of element, 56
comparison of, 270
dom4j, 294
iTunes module elements, 373
replacing using filter, 85-88
ROME module, 379
snapshot of replacement using XMLWriter, 89
RELAX NG namespace, 34
XML namespaces, 7
XML Schema, 33
URLLoader class, 421, 422
events, 423
URLRequest class, 422
URLs
defined, 47
for XML Schemas, 33
V[ Top ]
valid XML documents, 5
validate( ) method, 193
input and output types, 193
validateDocument( ) (DocumentEditVAL), 152
validating XML
against a DTD, 26
against an XML Schema, 33
against RELAX NG schema, 40
validation
configuring for parser factory, 159
initiating in SAX, 70
JAXB, 339-342
differences between 1.0 and 2.0, 321
events, 341
JAXB 1.0 features, 315
JAXB 2.0, 316
JAXP, 155, 189-195
creating SchemaFactory, 189-191
problems with, 195
representing constraint model, 192
validating XML, 192-195
performed by SAXReader instance, 292
SAX 2.0 feature, 439
Validation module (DOM), 93, 126, 148-153
checking for state validity, 152
checking for valid operations, 151
enforcing validity, 150
note types supporting validation, 148
validation schema for parser factory, 158
validation setting, handling with DOMConfiguration, 145
ValidationEvent interface, 341
ValidationEventHandler interface, 341
ValidationEventLocator interface, 341
Validator class, 192
Validator interface (deprecated), 340
ValidatorHandler interface, 193
value-of construct, 16
varargs (Java 5), 322
variables
XPath, 183-186, 274
support by JDOM, 273
versions, XML document, 440
view (MVC applications), 385
XML used for data passed to/from controller, 385
Views module (DOM), 92, 139
visit( ) method (Visitor), 291
Visitor interface, 303
Visitor object, 290
Visitor Pattern, 290, 303-305
VisitorSupport class, 303
W[ Top ]
W3C (World Wide Web Consortium)
DOM specification, 91
XML 1.0 Recommendation, 1
XML 1.1 specification, 9
XML activity page, 19
XML Schema
complete support in JAXB 2.0, 316
support by JAXB 1.0, 315
XML Schema (XSD), 21
XSL specification, 12
warnings in XML parsing, 237
SAX, 66
web applications, XML as presentation, 384-430
Ajax, 401-415
posting XML to the server, 411-415
using DOM with, 406-409
using XSLT with, 408
XMLHttpRequest, 402-407
Flash, 415-430
ActionScript, 415
Flex, 416
XML in ActionScript 3.0, 417-429
MVC pattern, 384-391
XML in, 385-391
transforming to HTML with JSP, 391-393
transforming to HTML with XSLT, 392-401
client-side transformations, 393-395
server-side transformations, 394-401
web page for this book, x
Web Services Developer Pack (see Java WSDP)
web technologies, 384
well-formed HTML, 130
well-formed XML, 5
JSPs and, 390
whitespace
dealing with in JDOM, 257
SAX parser handling of, 60
width attribute (XML Schema), 29
Wiki, ROME, 370
Wikipedia page for RSS, 350
wire feeds, 359
WireFeed class, 359, 360
WireFeedInput class, 365
WireFeedOutput class, 360
Wireless Markup Language (WML), 10
World Wide Web Consortium (see W3C)
writeAttribute( ) (XMLStreamWriter), 229, 231
writeEmptyElement( ) (XMLStreamWriter), 230
writeEndDocument( ) (XMLStreamWriter), 229, 231
Writer class, 89
Writer object, ROME feed output, 360
writers, SAX, 88
writeStartElement( ) (XMLStreamWriter), 231
X[ Top ]
Xalan-J, 19
Xalan-Java processor, 176
Xerces (SAX parser), 43
classpath, 43
DOM Level 3 functionality, 103
features and properties, online listing, 71
implementation of XMLReader, 45
versions used directly and with JAXP, 94
XHTML, 6, 19, 130
DOM Level 2 HTML module, 93
formatting in dom4j output, 297
XInclude processing, configuring for parser factory, 159
xjc application
compiling a schema, 324
JAXB 1.0 output, 326
JAXB 2.0 output, 329
output for JAXB 1.0 and 2.0, 326
target namespace for schema, 325
-use-runtime option, 329
XJCTask class, 324
XLink, 19
XML
core Java APIs (see DOM; SAX)
other related technologies, 19
transformations, 10-19
XPath, 13
XSL, 11
XSLT, 12
XML 1.0, 1-9
attributes, 6
elements, 4-6
entity references, 8
namespaces, 7
root element, 3
unparsed data (CDATA section), 9
XML 1.1, 9
SAX support, 439
XML module (DOM), 126
XML Schema, 21, 27-34
converting to RELAX NG schemas, 39
elements and attributes, 28
generating from a DTD, 31
generating from instance documents, 30
root element, 27
specification (web site), 28
support by JAXB 1.0, 315
support in JAXB 2.0, 316
validating XML against, 33
xml.stream.properties file, 199
XmlAccessorType annotation, 331
XmlAccessType class, 331
xml-apis.jar and xercesImpl.jar files, 43
XmlAttribute annotation, 333
XMLBeans binding framework, 347
XMLConstants class, 191
XmlElement annotation, 332
XMLEvent interface, 211, 233
getEventType( ), 213
StAX interfaces that extend, 212
XMLEventAllocator interface, 238
XMLEventConsumer interface, 238
XMLEventFactory class, creating event objects, 233
XMLEventReader interface, 197, 211-218
creating instances with XMLInputFactory, 200
encapsulation advantages (over XMLStream Reader), 217
event loop, 200
getLocation( ) method, 223
nextEvent( ) method, 213
nextTag( ) method, 218-220
peek( ) method, 224
StAX Tree Viewer example application, 213-216
XMLEventWriter interface, 197, 227, 233-235
Java object tree marshalled to, 316
XMLFilter interface, 84
chaining XMLReader implementations, 85
XMLHttpRequest object, 402-407
asynchronous use of, 404
onreadystatechange property, 404
posting content as the body of a request, 411
responseText property, 406
responseXML property, 406
send( ) method, 411
synchronous use of, 403
user switching between two documents without page reload, 405
XMLInputFactory class, 199
Boolean properties, 236
createFilteredReader( ), 225
creating a reader, 200
Object properties, 237
setProperty( ), 200, 235
xmllint, 27
--noout option, 27
--relaxng option, 40
--schema option, 34
xmlns attributes, 53, 439
writing with XMLStreamWriter, 231
XMLOutputFactory class, 199
createXMLEventWriter( ), 233
isRepairingNamespaces property, 238
setProperty( ) method, 235
support for Result, 228
XMLOutputter class, 246, 257
making format customizations stick, 258
other uses, 258
XMLProperties class, 259-269
loading XML, 263-265
problems with test output, 267-269
storing XML, 261-263
testing, 265
XmlPull, 239-242
XMLReader interface, 292
accessing directly with SAXParser, 162
chaining implementations through XMLFilters, 85
instantiating, 45-47
JAXP SAXParser wrapper, 160
methods for setting handlers, 49
methods to set properties and features, 71
registering content handler with instance, 63
registering entity resolver, 76
registering LexicalHandler with setProperty( ), 82
setDTDHandler( ), 78
XMLReporter interface, 237
XMLResolver interface, 237
XmlRootElement annotation, 331
XmlSchema annotation, 333
XMLSocket class, 424
events, 426
XmlStreamConstants class, 197
XMLStreamReader interface, 197, 200-211
encapsulation problem, 217
event loop, 199
filter, using, 225
getLocation( ) method, 223
methods by event type, 201
nextTag( ) method, 218-220
require( ) method, 221-223
START_DOCUMENT event, 204
XMLStreamWriter interface, 197, 227, 228-233
flush( ) method, 231
Java object tree marshalled to, 316
namespace support, 231
methods adding URI and prefix to namespace context, 232
writeEmptyElement( ) methods, 230
XmlType annotation, 332
XMLWriter class, 88, 295
methods to output XML, 90
XPath, 10, 13, 155, 176-189
creating instance of XPath interface, 178
document for XPath examples, 178-180
dom4j support for, 299-302
expressions that select node sets, 14
functions, 186-189
operating on node sets, 14
JDOM support for, 271-274
namespaces, 181-183
support by dom4j, 290
variables, 183-186
XPath interface, 177
obtaining an instance, 178
XPathConstants class, 178
XPathExpression object, 177
XPathFactory class, 178
XPathFunction interface, 187-189
XPathPattern class, 306
XPathVariableResolver interface, 184, 274
XPointer, 19
XPP3Reader class, 293
XQuery, 19, 432
xsd prefix, 27
XSL (Extensible Stylesheet Language), 10-12
formatting objects, 11
looping in, 16
performing transformations, 18
processing with JAXP, 155, 165-176
basic transformations, 166-173
caching transformation instructions, 174
changing processor implementation, 176
identity transformation, 173
stylesheet (example), 14
template matching, 15
tree structures for data, 11
W3C specification, 12
XSLT and XPath versus, 11
XSL stylesheets, 92
example, 306
XSLT (XSL Transformations), 10, 12
dom4j object-oriented transformation API, 291
transforming XML to HTML in web application, 392-401
using with Ajax, 408
XPath, 13
XSLTransformer class, 270
Y[ Top ]
Yahoo! podcast directory, 372
Z[ Top ]
zeroOrMore element, 35
Symbols[ Top ]
" (quotation marks, double)
" entity reference, 8
XML attributes, 6
$ (dollar sign), indicating variables, 183
& (ampersand) in XML entity references, 8
' (apostrophe), ' entity reference, 8
' (quotation marks, single)
' entity reference, 8
XML attributes, 6
* (asterisk), recurrence modifier, 22
+ (plus sign), recurrence modifier, 22
, (comma) operator, specifying order, 22
. (period), in Java property names, 249, 253
; (semicolon), in XML entity references, 8
< and > (angle brackets)
<!-- and --> comment delimiters, 82
<! opening of a DTD tag, 22
entity references in XML, 8
<![CDATA[ and ]]> for CDATA nodes, 106
? (question mark), recurrence operator, 22
| (pipe symbol)
combining constants defined by ContentFilter, 275
OR operator, 22
A[ Top ]
A9 Open Search module, 370
AbstractView interface, 139
accept( ) method
EventFilter and StreamFilter, 224
Node interface, 290
acceptNode( ) (NodeFilter), 132
Action interface, 306
ActionScript, 415
XML in ActionScript 3.0, 417-429
E4X, 420
Flash XML sockets, 423-426
sending and loading XML, 421
XML data providers, 421
ActiveX control, XMLHttpRequest as, 402
addContent( ) method, 245, 252, 253, 263
addElement( ) (Branch), 293
addNamespace( ) (XPath, 273
Adobe Flash (see Flash)
AElfred2 (SAX parser), 84
afterMarshal( ) (Listener), 346
afterUnmarshal( ) (Listener), 346
aggregators, 384
building, 365-369
Ajax, 401-415
online sources for information, 414
posting XML to the server, 411-415
creating XML document in JavaScript, 411
servlet to accept XML posts, 413
submitting XML document, 412-413
using DOM with, 406-409
using XSLT with, 408
XMLHttpRequest object, 402-407
allocate( ) method, 238
AndFilter class, 276
annotations, 315, 330-334
class-level, 330-332
XmlAccessorType, 331
XmlRootElement, 331
XmlType, 332
enabling binding of arbitrary Java classes, 316
Return to Java and XML