  
    
    
    
    
    
    
    
  
  
    
      
        
          
libxml2-HTMLparser.html            
Prev          
        
        
          
general.html            
Up          
        
        
          
index.html            
Home          
        
        
          
libxml2-SAX.html            
Next          
        
        
libxml2 Reference Manual      
    
    
      
HTMLtree    
    
HTMLtree - specific APIs to process HTML tree, especially serialization
    
this module implements a few function needed to process tree in an HTML specific way. 
    
Author(s): Daniel Veillard 
    
      
Synopsis
      
#define #HTML_ENTITY_REF_NODEHTML_ENTITY_REF_NODE ;
#define 
#HTML_COMMENT_NODEHTML_COMMENT_NODE ;
#define 
#HTML_PRESERVE_NODEHTML_PRESERVE_NODE ;
#define 
#HTML_TEXT_NODEHTML_TEXT_NODE ;
#define 
#HTML_PI_NODEHTML_PI_NODE ;
int	
#htmlNodeDumpFileFormathtmlNodeDumpFileFormat 		(FILE * out, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding, 					 int format);
void	
#htmlDocDumpMemoryhtmlDocDumpMemory 		( libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml2-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size);
int	
#htmlSaveFilehtmlSaveFile 			(const char * filename, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur);
int	
#htmlDocDumphtmlDocDump 			(FILE * f, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur);
void	
#htmlDocDumpMemoryFormathtmlDocDumpMemoryFormat 		( libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml2-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size, 					 int format);
int	
#htmlIsBooleanAttrhtmlIsBooleanAttr 		(const libxml2-xmlstring.html#xmlCharxmlChar  * name);
int	
#htmlSaveFileFormathtmlSaveFileFormat 		(const char * filename, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding, 					 int format);
void	
#htmlNodeDumpFormatOutputhtmlNodeDumpFormatOutput 	( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding, 					 int format);
int	
#htmlSetMetaEncodinghtmlSetMetaEncoding 		( libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * encoding);
int	
#htmlSaveFileEnchtmlSaveFileEnc 			(const char * filename, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding);
void	
#htmlNodeDumpOutputhtmlNodeDumpOutput 		( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding);
int	
#htmlNodeDumphtmlNodeDump 			( libxml2-tree.html#xmlBufferPtrxmlBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur);
libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr 	#htmlNewDochtmlNewDoc 		(const libxml2-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID);
const 
libxml2-xmlstring.html#xmlCharxmlChar  *	#htmlGetMetaEncodinghtmlGetMetaEncoding 	( libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc);
void	
#htmlNodeDumpFilehtmlNodeDumpFile 		(FILE * out, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur);
void	
#htmlDocContentDumpFormatOutputhtmlDocContentDumpFormatOutput 	( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding, 					 int format);
libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr 	#htmlNewDocNoDtDhtmlNewDocNoDtD 		(const libxml2-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID);
void	
#htmlDocContentDumpOutputhtmlDocContentDumpOutput 	( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding);
    
    
      
Description
    
    
      
Details
      
        
Macro HTML_COMMENT_NODE
#define #HTML_COMMENT_NODEHTML_COMMENT_NODE ;
Macro. A libxml2-SAX.html#commentcomment  in a HTML document is really implemented the same way as a libxml2-SAX.html#commentcomment  in an XML document.
        
        
Macro HTML_ENTITY_REF_NODE
#define #HTML_ENTITY_REF_NODEHTML_ENTITY_REF_NODE ;
Macro. An entity libxml2-SAX.html#referencereference  in a HTML document is really implemented the same way as an entity libxml2-SAX.html#referencereference  in an XML document.
        
        
Macro HTML_PI_NODE
#define #HTML_PI_NODEHTML_PI_NODE ;
Macro. A processing instruction in a HTML document is really implemented the same way as a processing instruction in an XML document.
        
        
Macro HTML_PRESERVE_NODE
#define #HTML_PRESERVE_NODEHTML_PRESERVE_NODE ;
Macro. A preserved node in a HTML document is really implemented the same way as a CDATA section in an XML document.
        
        
Macro HTML_TEXT_NODE
#define #HTML_TEXT_NODEHTML_TEXT_NODE ;
Macro. A text node in a HTML document is really implemented the same way as a text node in an XML document.
        
        
htmlDocContentDumpFormatOutput ()
void	htmlDocContentDumpFormatOutput	( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding, 					 int format)Dump an HTML document.
buf: the HTML buffer output cur: the document encoding: the encoding string format: should formatting spaces been added         
        
htmlDocContentDumpOutput ()
void	htmlDocContentDumpOutput	( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding)Dump an HTML document. Formating return/spaces are added.
buf: the HTML buffer output cur: the document encoding: the encoding string         
        
htmlDocDump ()
int	htmlDocDump			(FILE * f, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur)Dump an HTML document to an open FILE.
f: the FILE* cur: the document Returns: the number of byte written or -1 in case of failure.         
        
htmlDocDumpMemory ()
void	htmlDocDumpMemory		( libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml2-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size)Dump an HTML document in memory and return the libxml2-xmlstring.html#xmlCharxmlChar  * and it's size. It's up to the caller to free the memory.
cur: the document mem: OUT: the memory pointer size: OUT: the memory length         
        
htmlDocDumpMemoryFormat ()
void	htmlDocDumpMemoryFormat		( libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml2-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size, 					 int format)Dump an HTML document in memory and return the libxml2-xmlstring.html#xmlCharxmlChar  * and it's size. It's up to the caller to free the memory.
cur: the document mem: OUT: the memory pointer size: OUT: the memory length format: should formatting spaces been added         
        
htmlGetMetaEncoding ()
const libxml2-xmlstring.html#xmlCharxmlChar  *	htmlGetMetaEncoding	( libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc)Encoding definition lookup in the Meta tags
doc: the document Returns: the current encoding as flagged in the HTML source         
        
htmlIsBooleanAttr ()
int	htmlIsBooleanAttr		(const libxml2-xmlstring.html#xmlCharxmlChar  * name)Determine if a given libxml2-SAX.html#attributeattribute  is a boolean attribute.
name: the name of the libxml2-SAX.html#attributeattribute  to check Returns: false if the libxml2-SAX.html#attributeattribute  is not boolean, true otherwise.         
        
htmlNewDoc ()
libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr 	htmlNewDoc		(const libxml2-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID)Creates a new HTML document
URI: URI for the dtd, or NULL ExternalID: the external ID of the DTD, or NULL Returns: a new document         
        
htmlNewDocNoDtD ()
libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr 	htmlNewDocNoDtD		(const libxml2-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * ExternalID)Creates a new HTML document without a DTD node if @URI and @ExternalID are NULL
URI: URI for the dtd, or NULL ExternalID: the external ID of the DTD, or NULL Returns: a new document, do not initialize the DTD if not provided         
        
htmlNodeDump ()
int	htmlNodeDump			( libxml2-tree.html#xmlBufferPtrxmlBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur)Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added.
buf: the HTML buffer output doc: the document cur: the current node Returns: the number of byte written or -1 in case of error         
        
htmlNodeDumpFile ()
void	htmlNodeDumpFile		(FILE * out, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur)Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added.
out: the FILE pointer doc: the document cur: the current node         
        
htmlNodeDumpFileFormat ()
int	htmlNodeDumpFileFormat		(FILE * out, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding, 					 int format)Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == NULL try to save in the doc encoding
out: the FILE pointer doc: the document cur: the current node encoding: the document encoding format: should formatting spaces been added Returns: the number of byte written or -1 in case of failure.         
        
htmlNodeDumpFormatOutput ()
void	htmlNodeDumpFormatOutput	( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding, 					 int format)Dump an HTML node, recursive behaviour,children are printed too.
buf: the HTML buffer output doc: the document cur: the current node encoding: the encoding string format: should formatting spaces been added         
        
htmlNodeDumpOutput ()
void	htmlNodeDumpOutput		( libxml2-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding)Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.
buf: the HTML buffer output doc: the document cur: the current node encoding: the encoding string         
        
htmlSaveFile ()
int	htmlSaveFile			(const char * filename, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur)Dump an HTML document to a file. If @filename is "-" the stdout file is used.
filename: the filename (or URL) cur: the document Returns: the number of byte written or -1 in case of failure.         
        
htmlSaveFileEnc ()
int	htmlSaveFileEnc			(const char * filename, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding)Dump an HTML document to a file using a given encoding and formatting returns/spaces are added.
filename: the filename cur: the document encoding: the document encoding Returns: the number of byte written or -1 in case of failure.         
        
htmlSaveFileFormat ()
int	htmlSaveFileFormat		(const char * filename, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding, 					 int format)Dump an HTML document to a file using a given encoding.
filename: the filename cur: the document encoding: the document encoding format: should formatting spaces been added Returns: the number of byte written or -1 in case of failure.         
        
htmlSetMetaEncoding ()
int	htmlSetMetaEncoding		( libxml2-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * encoding)Sets the current encoding in the Meta tags NOTE: this will not change the document content encoding, just the META flag associated.
doc: the document encoding: the encoding string Returns: 0 in case of success and -1 in case of error         
      
    
  
