Java Reference
In-Depth Information
System.out.print("publicId=["+publicId+"]");
System.out.print("systemId=["+systemId+"]");
Sys-
tem.out.println("notationName=["+notationName+"]");
}
@Override
public void warning(SAXParseException saxpe)
{
System.out.println("warning() "+saxpe);
}
}
The Handler subclass is pretty straightforward; it outputs every possible piece of
informationaboutanXMLdocument,subjecttofeatureandpropertysettings.Youwill
find this class handy for exploring the order in which events occur along with various
features and properties.
After compiling Handler 's source code, execute java SAXDemo svg-ex-
amples.xml (see Listing10-4 ). SAXDemo respondsbypresentingthefollowingout-
put:
setDocumentLocator()
locator=[com.sun.org.apache.xerces.internal.parsers.
AbstractSAXParser$LocatorProxy@1f98d58]
startDocument()
startElement()
uri=[],
localName=[svg-examples],
qName=[svg-examples]
Column number=[15]
Line number=[2]
characters() [
]
startElement()
uri=[],
localName=[example],
qName=[example]
Column number=[13]
Line number=[3]
characters() [
The following Scalable Vector Graphics document de-
scribes a blue-filled and ]
Search WWH ::




Custom Search