Blame doc/html/libxml-SAX2.html

Packit 423ecb
Packit 423ecb
Packit 423ecb
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
Packit 423ecb
TD {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
Packit 423ecb
H1 {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
H2 {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
H3 {font-family: Verdana,Arial,Helvetica}
Packit 423ecb
A:link, A:visited, A:active { text-decoration: underline }
Packit 423ecb
</style><style type="text/css">
Packit 423ecb
      div.deprecated pre.programlisting {border-style: double;border-color:red}
Packit 423ecb
      pre.programlisting {border-style: double;background: #EECFA1}
Packit 423ecb
    </style><title>Module SAX2 from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module SAX2 from libxml2

<center>API Menu</center>
<form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form>
<center>API Indexes</center>
<center>Related links</center>

those are the default SAX2 interfaces used by the library when building DOM tree.

Table of Contents

void	docbDefaultSAXHandlerInit	(void)
Packit 423ecb
void	htmlDefaultSAXHandlerInit	(void)
Packit 423ecb
void	xmlDefaultSAXHandlerInit	(void)
Packit 423ecb
void	xmlSAX2AttributeDecl		(void * ctx, 
const xmlChar * elem,
const xmlChar * fullname,
int type,
int def,
const xmlChar * defaultValue,
xmlEnumerationPtr tree)
Packit 423ecb
void	xmlSAX2CDataBlock		(void * ctx, 
const xmlChar * value,
int len)
Packit 423ecb
void	xmlSAX2Characters		(void * ctx, 
const xmlChar * ch,
int len)
Packit 423ecb
void	xmlSAX2Comment			(void * ctx, 
const xmlChar * value)
Packit 423ecb
void	xmlSAX2ElementDecl		(void * ctx, 
const xmlChar * name,
int type,
xmlElementContentPtr content)
Packit 423ecb
void	xmlSAX2EndDocument		(void * ctx)
Packit 423ecb
void	xmlSAX2EndElement		(void * ctx, 
const xmlChar * name)
Packit 423ecb
void	xmlSAX2EndElementNs		(void * ctx, 
const xmlChar * localname,
const xmlChar * prefix,
const xmlChar * URI)
Packit 423ecb
void	xmlSAX2EntityDecl		(void * ctx, 
const xmlChar * name,
int type,
const xmlChar * publicId,
const xmlChar * systemId,
xmlChar * content)
Packit 423ecb
void	xmlSAX2ExternalSubset		(void * ctx, 
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID)
Packit 423ecb
int	xmlSAX2GetColumnNumber		(void * ctx)
Packit 423ecb
xmlEntityPtr	xmlSAX2GetEntity	(void * ctx, 
const xmlChar * name)
Packit 423ecb
int	xmlSAX2GetLineNumber		(void * ctx)
Packit 423ecb
xmlEntityPtr	xmlSAX2GetParameterEntity	(void * ctx, 
const xmlChar * name)
Packit 423ecb
const xmlChar *	xmlSAX2GetPublicId	(void * ctx)
Packit 423ecb
const xmlChar *	xmlSAX2GetSystemId	(void * ctx)
Packit 423ecb
int	xmlSAX2HasExternalSubset	(void * ctx)
Packit 423ecb
int	xmlSAX2HasInternalSubset	(void * ctx)
Packit 423ecb
void	xmlSAX2IgnorableWhitespace	(void * ctx, 
const xmlChar * ch,
int len)
Packit 423ecb
void	xmlSAX2InitDefaultSAXHandler	(xmlSAXHandler * hdlr, 
int warning)
Packit 423ecb
void	xmlSAX2InitDocbDefaultSAXHandler	(xmlSAXHandler * hdlr)
Packit 423ecb
void	xmlSAX2InitHtmlDefaultSAXHandler	(xmlSAXHandler * hdlr)
Packit 423ecb
void	xmlSAX2InternalSubset		(void * ctx, 
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID)
Packit 423ecb
int	xmlSAX2IsStandalone		(void * ctx)
Packit 423ecb
void	xmlSAX2NotationDecl		(void * ctx, 
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId)
Packit 423ecb
void	xmlSAX2ProcessingInstruction	(void * ctx, 
const xmlChar * target,
const xmlChar * data)
Packit 423ecb
void	xmlSAX2Reference		(void * ctx, 
const xmlChar * name)
Packit 423ecb
xmlParserInputPtr	xmlSAX2ResolveEntity	(void * ctx, 
const xmlChar * publicId,
const xmlChar * systemId)
Packit 423ecb
void	xmlSAX2SetDocumentLocator	(void * ctx, 
xmlSAXLocatorPtr loc)
Packit 423ecb
void	xmlSAX2StartDocument		(void * ctx)
Packit 423ecb
void	xmlSAX2StartElement		(void * ctx, 
const xmlChar * fullname,
const xmlChar ** atts)
Packit 423ecb
void	xmlSAX2StartElementNs		(void * ctx, 
const xmlChar * localname,
const xmlChar * prefix,
const xmlChar * URI,
int nb_namespaces,
const xmlChar ** namespaces,
int nb_attributes,
int nb_defaulted,
const xmlChar ** attributes)
Packit 423ecb
void	xmlSAX2UnparsedEntityDecl	(void * ctx, 
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId,
const xmlChar * notationName)
Packit 423ecb
int	xmlSAXDefaultVersion		(int version)
Packit 423ecb
int	xmlSAXVersion			(xmlSAXHandler * hdlr, 
int version)
Packit 423ecb

Description

Packit 423ecb

Function: docbDefaultSAXHandlerInit

void	docbDefaultSAXHandlerInit	(void)
Packit 423ecb

Initialize the default SAX handler

Packit 423ecb

Function: htmlDefaultSAXHandlerInit

void	htmlDefaultSAXHandlerInit	(void)
Packit 423ecb

Initialize the default SAX handler

Packit 423ecb

Function: xmlDefaultSAXHandlerInit

void	xmlDefaultSAXHandlerInit	(void)
Packit 423ecb

Initialize the default SAX2 handler

Packit 423ecb

Function: xmlSAX2AttributeDecl

void	xmlSAX2AttributeDecl		(void * ctx, 
const xmlChar * elem,
const xmlChar * fullname,
int type,
int def,
const xmlChar * defaultValue,
xmlEnumerationPtr tree)
Packit 423ecb

An attribute definition has been parsed

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>elem</tt>:the name of the element
<tt>fullname</tt>:the attribute name
<tt>type</tt>:the attribute type
<tt>def</tt>:the type of default value
<tt>defaultValue</tt>:the attribute default value
<tt>tree</tt>:the tree of enumerated value set

Function: xmlSAX2CDataBlock

void	xmlSAX2CDataBlock		(void * ctx, 
const xmlChar * value,
int len)
Packit 423ecb

called when a pcdata block has been parsed

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>value</tt>:The pcdata content
<tt>len</tt>:the block length

Function: xmlSAX2Characters

void	xmlSAX2Characters		(void * ctx, 
const xmlChar * ch,
int len)
Packit 423ecb

receiving some chars from the parser.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>ch</tt>:a xmlChar string
<tt>len</tt>:the number of xmlChar

Function: xmlSAX2Comment

void	xmlSAX2Comment			(void * ctx, 
const xmlChar * value)
Packit 423ecb

A xmlSAX2Comment has been parsed.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>value</tt>:the xmlSAX2Comment content

Function: xmlSAX2ElementDecl

void	xmlSAX2ElementDecl		(void * ctx, 
const xmlChar * name,
int type,
xmlElementContentPtr content)
Packit 423ecb

An element definition has been parsed

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:the element name
<tt>type</tt>:the element type
<tt>content</tt>:the element value tree

Function: xmlSAX2EndDocument

void	xmlSAX2EndDocument		(void * ctx)
Packit 423ecb

called when the document end has been detected.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)

Function: xmlSAX2EndElement

void	xmlSAX2EndElement		(void * ctx, 
const xmlChar * name)
Packit 423ecb

called when the end of an element has been detected.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:The element name

Function: xmlSAX2EndElementNs

void	xmlSAX2EndElementNs		(void * ctx, 
const xmlChar * localname,
const xmlChar * prefix,
const xmlChar * URI)
Packit 423ecb

SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>localname</tt>:the local name of the element
<tt>prefix</tt>:the element namespace prefix if available
<tt>URI</tt>:the element namespace name if available

Function: xmlSAX2EntityDecl

void	xmlSAX2EntityDecl		(void * ctx, 
const xmlChar * name,
int type,
const xmlChar * publicId,
const xmlChar * systemId,
xmlChar * content)
Packit 423ecb

An entity definition has been parsed

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:the entity name
<tt>type</tt>:the entity type
<tt>publicId</tt>:The public ID of the entity
<tt>systemId</tt>:The system ID of the entity
<tt>content</tt>:the entity value (without processing).

Function: xmlSAX2ExternalSubset

void	xmlSAX2ExternalSubset		(void * ctx, 
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID)
Packit 423ecb

Callback on external subset declaration.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:the root element name
<tt>ExternalID</tt>:the external ID
<tt>SystemID</tt>:the SYSTEM ID (e.g. filename or URL)

Function: xmlSAX2GetColumnNumber

int	xmlSAX2GetColumnNumber		(void * ctx)
Packit 423ecb

Provide the column number of the current parsing point.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:an int

Function: xmlSAX2GetEntity

xmlEntityPtr	xmlSAX2GetEntity	(void * ctx, 
const xmlChar * name)
Packit 423ecb

Get an entity by name

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:The entity name
<tt>Returns</tt>:the xmlEntityPtr if found.

Function: xmlSAX2GetLineNumber

int	xmlSAX2GetLineNumber		(void * ctx)
Packit 423ecb

Provide the line number of the current parsing point.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:an int

Function: xmlSAX2GetParameterEntity

xmlEntityPtr	xmlSAX2GetParameterEntity	(void * ctx, 
const xmlChar * name)
Packit 423ecb

Get a parameter entity by name

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:The entity name
<tt>Returns</tt>:the xmlEntityPtr if found.

Function: xmlSAX2GetPublicId

const xmlChar *	xmlSAX2GetPublicId	(void * ctx)
Packit 423ecb

Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:a xmlChar *

Function: xmlSAX2GetSystemId

const xmlChar *	xmlSAX2GetSystemId	(void * ctx)
Packit 423ecb

Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:a xmlChar *

Function: xmlSAX2HasExternalSubset

int	xmlSAX2HasExternalSubset	(void * ctx)
Packit 423ecb

Does this document has an external subset

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:1 if true

Function: xmlSAX2HasInternalSubset

int	xmlSAX2HasInternalSubset	(void * ctx)
Packit 423ecb

Does this document has an internal subset

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:1 if true

Function: xmlSAX2IgnorableWhitespace

void	xmlSAX2IgnorableWhitespace	(void * ctx, 
const xmlChar * ch,
int len)
Packit 423ecb

receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use xmlSAX2Characters

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>ch</tt>:a xmlChar string
<tt>len</tt>:the number of xmlChar

Function: xmlSAX2InitDefaultSAXHandler

void	xmlSAX2InitDefaultSAXHandler	(xmlSAXHandler * hdlr, 
int warning)
Packit 423ecb

Initialize the default XML SAX2 handler

Packit 423ecb
<tt>hdlr</tt>:the SAX handler
<tt>warning</tt>:flag if non-zero sets the handler warning procedure

Function: xmlSAX2InitDocbDefaultSAXHandler

void	xmlSAX2InitDocbDefaultSAXHandler	(xmlSAXHandler * hdlr)
Packit 423ecb

Initialize the default DocBook SAX2 handler

Packit 423ecb
<tt>hdlr</tt>:the SAX handler

Function: xmlSAX2InitHtmlDefaultSAXHandler

void	xmlSAX2InitHtmlDefaultSAXHandler	(xmlSAXHandler * hdlr)
Packit 423ecb

Initialize the default HTML SAX2 handler

Packit 423ecb
<tt>hdlr</tt>:the SAX handler

Function: xmlSAX2InternalSubset

void	xmlSAX2InternalSubset		(void * ctx, 
const xmlChar * name,
const xmlChar * ExternalID,
const xmlChar * SystemID)
Packit 423ecb

Callback on internal subset declaration.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:the root element name
<tt>ExternalID</tt>:the external ID
<tt>SystemID</tt>:the SYSTEM ID (e.g. filename or URL)

Function: xmlSAX2IsStandalone

int	xmlSAX2IsStandalone		(void * ctx)
Packit 423ecb

Is this document tagged standalone ?

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>Returns</tt>:1 if true

Function: xmlSAX2NotationDecl

void	xmlSAX2NotationDecl		(void * ctx, 
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId)
Packit 423ecb

What to do when a notation declaration has been parsed.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:The name of the notation
<tt>publicId</tt>:The public ID of the entity
<tt>systemId</tt>:The system ID of the entity

Function: xmlSAX2ProcessingInstruction

void	xmlSAX2ProcessingInstruction	(void * ctx, 
const xmlChar * target,
const xmlChar * data)
Packit 423ecb

A processing instruction has been parsed.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>target</tt>:the target name
<tt>data</tt>:the PI data's

Function: xmlSAX2Reference

void	xmlSAX2Reference		(void * ctx, 
const xmlChar * name)
Packit 423ecb

called when an entity xmlSAX2Reference is detected.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:The entity name

Function: xmlSAX2ResolveEntity

xmlParserInputPtr	xmlSAX2ResolveEntity	(void * ctx, 
const xmlChar * publicId,
const xmlChar * systemId)
Packit 423ecb

The entity loader, to control the loading of external entities, the application can either: - override this xmlSAX2ResolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>publicId</tt>:The public ID of the entity
<tt>systemId</tt>:The system ID of the entity
<tt>Returns</tt>:the xmlParserInputPtr if inlined or NULL for DOM behaviour.

Function: xmlSAX2SetDocumentLocator

void	xmlSAX2SetDocumentLocator	(void * ctx, 
xmlSAXLocatorPtr loc)
Packit 423ecb

Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>loc</tt>:A SAX Locator

Function: xmlSAX2StartDocument

void	xmlSAX2StartDocument		(void * ctx)
Packit 423ecb

called when the document start being processed.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)

Function: xmlSAX2StartElement

void	xmlSAX2StartElement		(void * ctx, 
const xmlChar * fullname,
const xmlChar ** atts)
Packit 423ecb

called when an opening tag has been processed.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>fullname</tt>:The element name, including namespace prefix
<tt>atts</tt>:An array of name/value attributes pairs, NULL terminated

Function: xmlSAX2StartElementNs

void	xmlSAX2StartElementNs		(void * ctx, 
const xmlChar * localname,
const xmlChar * prefix,
const xmlChar * URI,
int nb_namespaces,
const xmlChar ** namespaces,
int nb_attributes,
int nb_defaulted,
const xmlChar ** attributes)
Packit 423ecb

SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>localname</tt>:the local name of the element
<tt>prefix</tt>:the element namespace prefix if available
<tt>URI</tt>:the element namespace name if available
<tt>nb_namespaces</tt>:number of namespace definitions on that node
<tt>namespaces</tt>:pointer to the array of prefix/URI pairs namespace definitions
<tt>nb_attributes</tt>:the number of attributes on that node
<tt>nb_defaulted</tt>:the number of defaulted attributes.
<tt>attributes</tt>:pointer to the array of (localname/prefix/URI/value/end) attribute values.

Function: xmlSAX2UnparsedEntityDecl

void	xmlSAX2UnparsedEntityDecl	(void * ctx, 
const xmlChar * name,
const xmlChar * publicId,
const xmlChar * systemId,
const xmlChar * notationName)
Packit 423ecb

What to do when an unparsed entity declaration is parsed

Packit 423ecb
<tt>ctx</tt>:the user data (XML parser context)
<tt>name</tt>:The name of the entity
<tt>publicId</tt>:The public ID of the entity
<tt>systemId</tt>:The system ID of the entity
<tt>notationName</tt>:the name of the notation

Function: xmlSAXDefaultVersion

int	xmlSAXDefaultVersion		(int version)
Packit 423ecb

Set the default version of SAX used globally by the library. By default, during initialization the default is set to 2. Note that it is generally a better coding style to use xmlSAXVersion() to set up the version explicitly for a given parsing context.

Packit 423ecb
<tt>version</tt>:the version, 1 or 2
<tt>Returns</tt>:the previous value in case of success and -1 in case of error.

Function: xmlSAXVersion

int	xmlSAXVersion			(xmlSAXHandler * hdlr, 
int version)
Packit 423ecb

Initialize the default XML SAX handler according to the version

Packit 423ecb
<tt>hdlr</tt>:the SAX handler
<tt>version</tt>:the version, 1 or 2
<tt>Returns</tt>:0 in case of success and -1 in case of error.

Daniel Veillard

</body></html>