de.zeigermann.xpa
Interface XMLFragmentHandler

All Known Implementing Classes:
DefaultXMLFragmentHandler

public interface XMLFragmentHandler

SAX like interface for call backs from XMLFragmentParser. Implenent this interface and register it to XMLFragmentParser to receive events parsed XML. You can also inherit from DefaultXMLFragmentHandler for convenience.


Method Summary
 void cdata(String cdata)
          Receives notification of character data.
 void comment(String comment)
          Receives notification of a comment.
 void doctype(String rootElement, String pubId, String sysId, String internalDTD)
          Receives notification of the document type declaration of the XML document.
 void emptyElement(String name, AttributesImpl attributes)
          Receives notification of the empty element.
 void endElement(String name)
          Receives notification of the end of an element.
 void endFragment()
          Receives notification of the end of a fragment.
 void pcdata(String pcdata)
          Receives notification of parseable character data.
 void pi(String target, AttributesImpl attributes)
          Receives notification of a processing instruction.
 void startElement(String name, AttributesImpl attributes)
          Receives notification of the beginning of an element.
 void startFragment()
          Receives notification of the beginning of a fragment.
 void xmlDeclaration(String target, AttributesImpl attributes)
          Receives notification of the XML declaration.
 

Method Detail

xmlDeclaration

public void xmlDeclaration(String target,
                           AttributesImpl attributes)
Receives notification of the XML declaration.

Parameters:
target - xml or XML
attributes - all additional information for this declaration (as version, encoding) put into attribtues as name/value pairs

doctype

public void doctype(String rootElement,
                    String pubId,
                    String sysId,
                    String internalDTD)
Receives notification of the document type declaration of the XML document.

Parameters:
rootElement - the root element of the XML document
pubId - the public id of the DTD or null if there is none
sysId - the system id of the DTD or null if there is none
internalDTD - the internal DTD or null if there is none; it will be notified as a single completely unparsed text block

startFragment

public void startFragment()
Receives notification of the beginning of a fragment. This method will be called exactly once per parse and before any other call back.


endFragment

public void endFragment()
Receives notification of the end of a fragment. This method will be called exactly once per parse and no other call back will follow this one.


startElement

public void startElement(String name,
                         AttributesImpl attributes)
Receives notification of the beginning of an element.

Parameters:
name - the full name of this element
attributes - the attributes associated with this element
See Also:
emptyElement(java.lang.String, org.xml.sax.helpers.AttributesImpl), endElement(java.lang.String)

emptyElement

public void emptyElement(String name,
                         AttributesImpl attributes)
Receives notification of the empty element. No end tag notification will follow this one as it is empty.

This notification will only be thrown if the tag in the XML document was really written in short form. I.e. <empty/> will create this notification while <empty></empty> will call startElement(java.lang.String, org.xml.sax.helpers.AttributesImpl) followed endElement(java.lang.String).

Parameters:
name - the full name of this element
attributes - the attributes associated with this element
See Also:
startElement(java.lang.String, org.xml.sax.helpers.AttributesImpl), endElement(java.lang.String)

endElement

public void endElement(String name)
Receives notification of the end of an element. This notification will not be thrown when an element has been notified by emptyElement(java.lang.String, org.xml.sax.helpers.AttributesImpl) before.

Parameters:
name - the full name of this element
See Also:
emptyElement(java.lang.String, org.xml.sax.helpers.AttributesImpl), startElement(java.lang.String, org.xml.sax.helpers.AttributesImpl)

pcdata

public void pcdata(String pcdata)
Receives notification of parseable character data. As XMLFragmentParser has no means to identify ignorable whitespace, it will be notified here as well.

Parameters:
pcdata - parseable character data from XML document

cdata

public void cdata(String cdata)
Receives notification of character data. This data may contain characters that need to be encoded to be parseable. Usually this notification is thrown upon occurence of a CDATA section.


pi

public void pi(String target,
               AttributesImpl attributes)
Receives notification of a processing instruction.

Parameters:
target - identifies the application or purpose this PI is for
attributes - all additional information for this PI put into attribtues as name/value pairs

comment

public void comment(String comment)
Receives notification of a comment.

Parameters:
comment - the text of the comment


Copyright 1999-2003 Oliver Zeigermann. All Rights Reserved.