1.

Name some of the important SAX parsing methods.

Answer»

ContentHandler Interface specifies the callback methods that the SAX parser uses to notify an application program of the components of the XML document that it has seen.

  • void startDocument() - Called at the beginning of a document.

  • void endDocument() - Called at the end of a document.

  • void startElement(String uri, String localName, String qName, Attributes atts) - Called at the beginning of an element.

  • void endElement(String uri, String localName,String qName) - Called at the end of an element.

  • void characters(char[] ch, int start, int length) - Called when character data is encountered.

  • void ignorableWhitespace( char[] ch, int start, int length) - Called when a DTD is present and ignorable whitespace is encountered.

  • void processingInstruction(String target, String data) - Called when a processing instruction is recognized.

  • void setDocumentLocator(Locator locator)) - Provides a Locator that can be used to identify positions in the document.

  • void skippedEntity(String name) - Called when an unresolved entity is encountered.

  • void startPrefixMapping(String prefix, String uri) - Called when a new namespace mapping is defined.

  • void endPrefixMapping(String prefix) - Called when a namespace definition ends its scope.



Discussion

No Comment Found