nsIExpatSink
| IID: | f61c56b5-ea5b-42b4-ad3c-17416e72e238 |
| 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* version , PRUnichar* encoding , PRInt32 standalone )
PRBool ReportError ( PRUnichar* errorText , PRUnichar* sourceText , nsIScriptError error )
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* version , PRUnichar* encoding , PRInt32 standalone )
Handle the XML Declaration.
- Arguments:
- version: The version string, can be null if not specified.
- encoding: The encoding string, can be null if not specified.
- standalone: -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes.
PRBool ReportError ( PRUnichar* errorText , PRUnichar* sourceText , nsIScriptError error )
Ask the content sink if the expat driver should log an error to the console.
- Arguments:
- errorText: Error message to pass to content sink.
- sourceText: Source text of the document we're parsing.
- error: Script error object with line number & column number
Reference documentation is generated from Mozilla's source.
