  
    
    
    
    
    
    
    
  
  
    
      
        
          
libxml2-SAX.html            
Prev          
        
        
          
general.html            
Up          
        
        
          
index.html            
Home          
        
        
          
libxml2-c14n.html            
Next          
        
        
libxml2 Reference Manual      
    
    
      
SAX2    
    
SAX2 - SAX2 parser interface used to build the DOM tree
    
those are the default SAX2 interfaces used by the library when building DOM tree. 
    
Author(s): Daniel Veillard 
    
      
Synopsis
      
void	#xmlSAX2EndElementNsxmlSAX2EndElementNs 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * localname, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * prefix, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * URI);
void	
#xmlSAX2ReferencexmlSAX2Reference 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name);
void	
#xmlSAX2ElementDeclxmlSAX2ElementDecl 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 int type, 					 libxml2-tree.html#xmlElementContentPtrxmlElementContentPtr  content);
void	
#xmlSAX2AttributeDeclxmlSAX2AttributeDecl 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * elem, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * fullname, 					 int type, 					 int def, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * defaultValue, 					 libxml2-tree.html#xmlEnumerationPtrxmlEnumerationPtr  tree);
void	
#xmlSAX2CommentxmlSAX2Comment 			(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * value);
int	
#xmlSAX2GetColumnNumberxmlSAX2GetColumnNumber 		(void * ctx);
libxml2-tree.html#xmlEntityPtrxmlEntityPtr 	#xmlSAX2GetEntityxmlSAX2GetEntity 	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name);
void	
#xmlSAX2UnparsedEntityDeclxmlSAX2UnparsedEntityDecl 	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * notationName);
void	
#xmlSAX2InitDocbDefaultSAXHandlerxmlSAX2InitDocbDefaultSAXHandler 	( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr);
int	
#xmlSAXVersionxmlSAXVersion 			( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr, 					 int version);
void	
#xmlSAX2IgnorableWhitespacexmlSAX2IgnorableWhitespace 	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ch, 					 int len);
void	
#xmlSAX2NotationDeclxmlSAX2NotationDecl 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId);
void	
#xmlSAX2StartDocumentxmlSAX2StartDocument 		(void * ctx);
void	
#xmlSAX2EndElementxmlSAX2EndElement 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name);
libxml2-tree.html#xmlParserInputPtrxmlParserInputPtr 	#xmlSAX2ResolveEntityxmlSAX2ResolveEntity 	(void * ctx, 						 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 						 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId);
void	
#xmlSAX2ExternalSubsetxmlSAX2ExternalSubset 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * SystemID);
const 
libxml2-xmlstring.html#xmlCharxmlChar  *	#xmlSAX2GetPublicIdxmlSAX2GetPublicId 	(void * ctx);
int	
#xmlSAX2IsStandalonexmlSAX2IsStandalone 		(void * ctx);
void	
#xmlSAX2EndDocumentxmlSAX2EndDocument 		(void * ctx);
void	
#xmlSAX2ProcessingInstructionxmlSAX2ProcessingInstruction 	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * target, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * data);
void	
#xmlSAX2InternalSubsetxmlSAX2InternalSubset 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * SystemID);
void	
#xmlSAX2CharactersxmlSAX2Characters 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ch, 					 int len);
int	
#xmlSAXDefaultVersionxmlSAXDefaultVersion 		(int version);
void	
#xmlSAX2StartElementxmlSAX2StartElement 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * fullname, 					 const libxml2-xmlstring.html#xmlCharxmlChar  ** atts);
void	
#xmlSAX2SetDocumentLocatorxmlSAX2SetDocumentLocator 	(void * ctx, 					 libxml2-tree.html#xmlSAXLocatorPtrxmlSAXLocatorPtr  loc);
void	
#xmlSAX2CDataBlockxmlSAX2CDataBlock 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * value, 					 int len);
void	
#xmlSAX2StartElementNsxmlSAX2StartElementNs 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * localname, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * prefix, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * URI, 					 int nb_namespaces, 					 const libxml2-xmlstring.html#xmlCharxmlChar  ** namespaces, 					 int nb_attributes, 					 int nb_defaulted, 					 const libxml2-xmlstring.html#xmlCharxmlChar  ** attributes);
int	
#xmlSAX2HasExternalSubsetxmlSAX2HasExternalSubset 	(void * ctx);
void	
#htmlDefaultSAXHandlerInithtmlDefaultSAXHandlerInit 	(void);
int	
#xmlSAX2GetLineNumberxmlSAX2GetLineNumber 		(void * ctx);
int	
#xmlSAX2HasInternalSubsetxmlSAX2HasInternalSubset 	(void * ctx);
void	
#xmlSAX2InitHtmlDefaultSAXHandlerxmlSAX2InitHtmlDefaultSAXHandler 	( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr);
void	
#docbDefaultSAXHandlerInitdocbDefaultSAXHandlerInit 	(void);
void	
#xmlDefaultSAXHandlerInitxmlDefaultSAXHandlerInit 	(void);
void	
#xmlSAX2InitDefaultSAXHandlerxmlSAX2InitDefaultSAXHandler 	( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr, 					 int warning);
libxml2-tree.html#xmlEntityPtrxmlEntityPtr 	#xmlSAX2GetParameterEntityxmlSAX2GetParameterEntity 	(void * ctx, 						 const libxml2-xmlstring.html#xmlCharxmlChar  * name);
const 
libxml2-xmlstring.html#xmlCharxmlChar  *	#xmlSAX2GetSystemIdxmlSAX2GetSystemId 	(void * ctx);
void	
#xmlSAX2EntityDeclxmlSAX2EntityDecl 		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 int type, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId, 					 libxml2-xmlstring.html#xmlCharxmlChar  * content);
    
    
      
Description
    
    
      
Details
      
        
docbDefaultSAXHandlerInit ()
void	docbDefaultSAXHandlerInit	(void)Initialize the default SAX handler
        
        
htmlDefaultSAXHandlerInit ()
void	htmlDefaultSAXHandlerInit	(void)Initialize the default SAX handler
        
        
xmlDefaultSAXHandlerInit ()
void	xmlDefaultSAXHandlerInit	(void)Initialize the default SAX2 handler
        
        
xmlSAX2AttributeDecl ()
void	xmlSAX2AttributeDecl		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * elem, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * fullname, 					 int type, 					 int def, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * defaultValue, 					 libxml2-tree.html#xmlEnumerationPtrxmlEnumerationPtr  tree)An libxml2-SAX.html#attributeattribute  definition has been parsed
ctx: the user data (XML parser context) elem: the name of the element fullname: the libxml2-SAX.html#attributeattribute  name type: the libxml2-SAX.html#attributeattribute  type def: the type of default value defaultValue: the libxml2-SAX.html#attributeattribute  default value tree: the tree of enumerated value set         
        
xmlSAX2CDataBlock ()
void	xmlSAX2CDataBlock		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * value, 					 int len)called when a pcdata block has been parsed
ctx: the user data (XML parser context) value: The pcdata content len: the block length         
        
xmlSAX2Characters ()
void	xmlSAX2Characters		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ch, 					 int len)receiving some chars from the parser.
ctx: the user data (XML parser context) ch: a libxml2-xmlstring.html#xmlCharxmlChar  string len: the number of libxml2-xmlstring.html#xmlCharxmlChar         
        
xmlSAX2Comment ()
void	xmlSAX2Comment			(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * value)A libxml2-SAX2.html#xmlSAX2CommentxmlSAX2Comment  has been parsed.
ctx: the user data (XML parser context) value: the libxml2-SAX2.html#xmlSAX2CommentxmlSAX2Comment  content         
        
xmlSAX2ElementDecl ()
void	xmlSAX2ElementDecl		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 int type, 					 libxml2-tree.html#xmlElementContentPtrxmlElementContentPtr  content)An element definition has been parsed
ctx: the user data (XML parser context) name: the element name type: the element type content: the element value tree         
        
xmlSAX2EndDocument ()
void	xmlSAX2EndDocument		(void * ctx)called when the document end has been detected.
ctx: the user data (XML parser context)         
        
xmlSAX2EndElement ()
void	xmlSAX2EndElement		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name)called when the end of an element has been detected.
ctx: the user data (XML parser context) name: The element name         
        
xmlSAX2EndElementNs ()
void	xmlSAX2EndElementNs		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * localname, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * prefix, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * URI)SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.
ctx: the user data (XML parser context) localname: the local name of the element prefix: the element namespace prefix if available URI: the element namespace name if available         
        
xmlSAX2EntityDecl ()
void	xmlSAX2EntityDecl		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 int type, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId, 					 libxml2-xmlstring.html#xmlCharxmlChar  * content)An entity definition has been parsed
ctx: the user data (XML parser context) name: the entity name type: the entity type publicId: The public ID of the entity systemId: The system ID of the entity content: the entity value (without processing).         
        
xmlSAX2ExternalSubset ()
void	xmlSAX2ExternalSubset		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * SystemID)Callback on external subset declaration.
ctx: the user data (XML parser context) name: the root element name ExternalID: the external ID SystemID: the SYSTEM ID (e.g. filename or URL)         
        
xmlSAX2GetColumnNumber ()
int	xmlSAX2GetColumnNumber		(void * ctx)Provide the column number of the current parsing point.
ctx: the user data (XML parser context) Returns: an int         
        
xmlSAX2GetEntity ()
libxml2-tree.html#xmlEntityPtrxmlEntityPtr 	xmlSAX2GetEntity	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name)Get an entity by name
ctx: the user data (XML parser context) name: The entity name Returns: the libxml2-tree.html#xmlEntityPtrxmlEntityPtr  if found.         
        
xmlSAX2GetLineNumber ()
int	xmlSAX2GetLineNumber		(void * ctx)Provide the line number of the current parsing point.
ctx: the user data (XML parser context) Returns: an int         
        
xmlSAX2GetParameterEntity ()
libxml2-tree.html#xmlEntityPtrxmlEntityPtr 	xmlSAX2GetParameterEntity	(void * ctx, 						 const libxml2-xmlstring.html#xmlCharxmlChar  * name)Get a parameter entity by name
ctx: the user data (XML parser context) name: The entity name Returns: the libxml2-tree.html#xmlEntityPtrxmlEntityPtr  if found.         
        
xmlSAX2GetPublicId ()
const libxml2-xmlstring.html#xmlCharxmlChar  *	xmlSAX2GetPublicId	(void * ctx)Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
ctx: the user data (XML parser context) Returns: a libxml2-xmlstring.html#xmlCharxmlChar  *         
        
xmlSAX2GetSystemId ()
const libxml2-xmlstring.html#xmlCharxmlChar  *	xmlSAX2GetSystemId	(void * ctx)Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd
ctx: the user data (XML parser context) Returns: a libxml2-xmlstring.html#xmlCharxmlChar  *         
        
xmlSAX2HasExternalSubset ()
int	xmlSAX2HasExternalSubset	(void * ctx)Does this document has an external subset
ctx: the user data (XML parser context) Returns: 1 if true         
        
xmlSAX2HasInternalSubset ()
int	xmlSAX2HasInternalSubset	(void * ctx)Does this document has an internal subset
ctx: the user data (XML parser context) Returns: 1 if true         
        
xmlSAX2IgnorableWhitespace ()
void	xmlSAX2IgnorableWhitespace	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ch, 					 int len)receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use libxml2-SAX2.html#xmlSAX2CharactersxmlSAX2Characters 
ctx: the user data (XML parser context) ch: a libxml2-xmlstring.html#xmlCharxmlChar  string len: the number of libxml2-xmlstring.html#xmlCharxmlChar         
        
xmlSAX2InitDefaultSAXHandler ()
void	xmlSAX2InitDefaultSAXHandler	( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr, 					 int warning)Initialize the default XML SAX2 handler
hdlr: the SAX handler warning: flag if non-zero sets the handler warning procedure         
        
xmlSAX2InitDocbDefaultSAXHandler ()
void	xmlSAX2InitDocbDefaultSAXHandler	( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr)Initialize the default DocBook SAX2 handler
hdlr: the SAX handler         
        
xmlSAX2InitHtmlDefaultSAXHandler ()
void	xmlSAX2InitHtmlDefaultSAXHandler	( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr)Initialize the default HTML SAX2 handler
hdlr: the SAX handler         
        
xmlSAX2InternalSubset ()
void	xmlSAX2InternalSubset		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * SystemID)Callback on internal subset declaration.
ctx: the user data (XML parser context) name: the root element name ExternalID: the external ID SystemID: the SYSTEM ID (e.g. filename or URL)         
        
xmlSAX2IsStandalone ()
int	xmlSAX2IsStandalone		(void * ctx)Is this document tagged standalone ?
ctx: the user data (XML parser context) Returns: 1 if true         
        
xmlSAX2NotationDecl ()
void	xmlSAX2NotationDecl		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId)What to do when a notation declaration has been parsed.
ctx: the user data (XML parser context) name: The name of the notation publicId: The public ID of the entity systemId: The system ID of the entity         
        
xmlSAX2ProcessingInstruction ()
void	xmlSAX2ProcessingInstruction	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * target, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * data)A processing instruction has been parsed.
ctx: the user data (XML parser context) target: the target name data: the PI data's         
        
xmlSAX2Reference ()
void	xmlSAX2Reference		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name)called when an entity libxml2-SAX2.html#xmlSAX2ReferencexmlSAX2Reference  is detected.
ctx: the user data (XML parser context) name: The entity name         
        
xmlSAX2ResolveEntity ()
libxml2-tree.html#xmlParserInputPtrxmlParserInputPtr 	xmlSAX2ResolveEntity	(void * ctx, 						 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 						 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId)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
ctx: the user data (XML parser context) publicId: The public ID of the entity systemId: The system ID of the entity Returns: the libxml2-tree.html#xmlParserInputPtrxmlParserInputPtr  if inlined or NULL for DOM behaviour.         
        
xmlSAX2SetDocumentLocator ()
void	xmlSAX2SetDocumentLocator	(void * ctx, 					 libxml2-tree.html#xmlSAXLocatorPtrxmlSAXLocatorPtr  loc)Receive the document locator at startup, actually libxml2-globals.html#xmlDefaultSAXLocatorxmlDefaultSAXLocator  Everything is available on the context, so this is useless in our case.
ctx: the user data (XML parser context) loc: A SAX Locator         
        
xmlSAX2StartDocument ()
void	xmlSAX2StartDocument		(void * ctx)called when the document start being processed.
ctx: the user data (XML parser context)         
        
xmlSAX2StartElement ()
void	xmlSAX2StartElement		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * fullname, 					 const libxml2-xmlstring.html#xmlCharxmlChar  ** atts)called when an opening tag has been processed.
ctx: the user data (XML parser context) fullname: The element name, including namespace prefix atts: An array of name/value attributes pairs, NULL terminated         
        
xmlSAX2StartElementNs ()
void	xmlSAX2StartElementNs		(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * localname, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * prefix, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * URI, 					 int nb_namespaces, 					 const libxml2-xmlstring.html#xmlCharxmlChar  ** namespaces, 					 int nb_attributes, 					 int nb_defaulted, 					 const libxml2-xmlstring.html#xmlCharxmlChar  ** attributes)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.
ctx: the user data (XML parser context) localname: the local name of the element prefix: the element namespace prefix if available URI: the element namespace name if available nb_namespaces: number of namespace definitions on that node namespaces: pointer to the array of prefix/URI pairs namespace definitions nb_attributes: the number of attributes on that node nb_defaulted: the number of defaulted attributes. attributes: pointer to the array of (localname/prefix/URI/value/end) libxml2-SAX.html#attributeattribute  values.         
        
xmlSAX2UnparsedEntityDecl ()
void	xmlSAX2UnparsedEntityDecl	(void * ctx, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * publicId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * systemId, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * notationName)What to do when an unparsed entity declaration is parsed
ctx: the user data (XML parser context) name: The name of the entity publicId: The public ID of the entity systemId: The system ID of the entity notationName: the name of the notation         
        
xmlSAXDefaultVersion ()
int	xmlSAXDefaultVersion		(int version)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.
version: the version, 1 or 2 Returns: the previous value in case of success and -1 in case of error.         
        
xmlSAXVersion ()
int	xmlSAXVersion			( libxml2-tree.html#xmlSAXHandlerxmlSAXHandler  * hdlr, 					 int version)Initialize the default XML SAX handler according to the version
hdlr: the SAX handler version: the version, 1 or 2 Returns: 0 in case of success and -1 in case of error.         
      
    
  
