nsIExpatSink

IID:1DEEA160-C661-11d5-84CC-0010A4E0C706
Inherits From:nsISupports

This interface should be implemented by any content sink that wants to get output from expat and do something with it; in other words, by any sink that handles some sort of XML dialect.

This interface is implemented by the following components:


Methods

void HandleCDataSection ( PRUnichar* data , PRUint32 length ) void HandleCharacterData ( PRUnichar* data , PRUint32 length ) void HandleComment ( PRUnichar* commentText ) void HandleDoctypeDecl ( AString subset , AString name , AString systemId , AString publicId , nsISupports catalogData ) void HandleEndElement ( PRUnichar* name ) void HandleProcessingInstruction ( PRUnichar* target , PRUnichar* data ) void HandleStartElement ( PRUnichar* name , arrayof PRUnichar* atts , PRUint32 attsCount , PRInt32 index , PRUint32 lineNumber ) void HandleXMLDeclaration ( PRUnichar* data , PRUint32 length ) void ReportError ( PRUnichar* errorText , PRUnichar* sourceText )

void HandleCDataSection ( PRUnichar* data , PRUint32 length )

Called to handle a CDATA section

Arguments:
data: the text in the CDATA section. This is null-terminated.
length: the length of the data string

void HandleCharacterData ( PRUnichar* data , PRUint32 length )

Called to handle character data. Note that this does NOT get called for the contents of CDATA sections.

Arguments:
data: the data to handle. data is NOT NULL-TERMINATED.
length: the length of the data string

void HandleComment ( PRUnichar* commentText )

Called to handle a comment

Arguments:
commentText: the text of the comment (not including the "")

void HandleDoctypeDecl ( AString subset , AString name , AString systemId , AString publicId , nsISupports catalogData )

Called to handle the doctype declaration

Arguments:
subset
name
systemId
publicId
catalogData

void HandleEndElement ( PRUnichar* name )

Called to handle the closing tag of an element.

Arguments:
name: the fully qualified tagname of the element

void HandleProcessingInstruction ( PRUnichar* target , PRUnichar* data )

Called to handle a processing instruction

Arguments:
target: the PI target (e.g. xml-stylesheet)
data: all the rest of the data in the PI

void HandleStartElement ( PRUnichar* name , arrayof PRUnichar* atts , PRUint32 attsCount , PRInt32 index , PRUint32 lineNumber )

Called to handle the opening tag of an element.

Arguments:
name: the fully qualified tagname of the element
atts: the array of attribute names and values. There are attsCount/2 names and attsCount/2 values, so the total number of elements in the array is attsCount. The names and values alternate. Thus, if we number attributes starting with 0, atts[2*k] is the name of the k-th attribute and atts[2*k+1] is the value of that attribute Both explicitly specified attributes and attributes that are defined to have default values in a DTD are present in atts.
attsCount: the number of elements in atts.
index: If the element has an attribute of type ID, then atts[index] is the name of that attribute. Otherwise, index is -1
lineNumber: the line number of the start tag in the data stream.

void HandleXMLDeclaration ( PRUnichar* data , PRUint32 length )

Handle the XML Declaration.

Arguments:
data: The string.
length: The length of the declaration from opening '<' to closing '>'.

void ReportError ( PRUnichar* errorText , PRUnichar* sourceText )

Arguments:
errorText
sourceText

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com