Default handlers for the SAX-style event XML parser

DESCRIPTION:

This function that returns a list containing the default handlers for use with for parsing XML documents via the SAX-style parsing.

USAGE:

xmlEventHandler()

DETAILS:

These handlers simply build up the DOM tree and thus perform the same job as xmlTreeParse. It is here more as an example, reference and a base that users can extend.

VALUE:

The return value is a list of functions which are used as callbacks by the internal XML parser when it encounters certain XML elements/structures. These include items such as the start of an element, end of an element, processing instruction, text node, comment, entity references and definitions, etc.
startElement
Function called at the start of a new XML element.
endElement
Function called at the end of a XML element.
processingInstruction
Function called for an XML processing instruction.
text
Function called for an XML text node.
comment
Function called for an XML comment node.
externalEntity
Function called for an XML entity.
entityDeclaration
Function called for an XML entity declaration.
getDOM
Function that returns the final DOM object after parsing.

NOTE:

Only one xmlOutputDOM or xmlOutputBuffer object can be active (attached) at a time. When you activate/attach a new object, you may lose the information you had built up in the previously attached object. Calling the xmlEventHandler function automatically activates/attaches its xmlOutputDOM object; with the other functions, you must first call the function, and then attach the object.

AUTHOR(S):

Duncan Temple Lang

REFERENCES:

http://www.w3.org/XML, http://www.jclark.com/xml, http://www.omegahat.org

SEE ALSO:

, ,

EXAMPLES:

con <- xmlEventParse(system.file("exampleData", "mtcars.xml", package="XML"),
               handlers=xmlEventHandler())
con$getDOM()
detach.DOM()