http://swpat.ffii.org/Action against software patents http://www.gnome.org/Gnome2 Logo http://www.w3.org/StatusW3C Logo http://www.redhat.com/Red Hat Logo http://xmlsoft.org/Made with Libxml2 Logo 
Module HTMLtree from libxml2
API Menu ../index.htmlMain Menu ../docs.htmlDeveloper Menu ../examples/index.htmlCode Examples index.htmlAPI Menu libxml-parser.htmlParser API libxml-tree.htmlTree API libxml-xmlreader.htmlReader API ../guidelines.htmlXML Guidelines ../ChangeLog.htmlChangeLog API Indexes ../APIchunk0.htmlAlphabetic ../APIconstructors.htmlConstructors ../APIfunctions.htmlFunctions/Types ../APIfiles.htmlModules ../APIsymbols.htmlSymbols Related links http://mail.gnome.org/archives/xml/Mail archive http://xmlsoft.org/XSLT/XSLT libxslt http://phd.cs.unibo.it/gdome2/DOM gdome2 http://www.aleksey.com/xmlsec/XML-DSig xmlsec ftp://xmlsoft.org/FTP http://www.zlatkovic.com/projects/libxml/Windows binaries http://www.blastwave.org/packages.php/libxml2Solaris binaries http://www.explain.com.au/oss/libxml2xslt.htmlMacOsX binaries http://libxmlplusplus.sourceforge.net/C++ bindings http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4PHP bindings http://sourceforge.net/projects/libxml2-pas/Pascal bindings http://rubyforge.org/projects/xml-tools/Ruby bindings http://tclxml.sourceforge.net/Tcl bindings http://bugzilla.gnome.org/buglist.cgi?product=libxml2Bug Tracker libxml-HTMLparser.htmlPrev libxml-HTMLparser.htmlHTMLparser index.htmlUp index.htmlAPI documentation ../index.htmlHome ../index.htmlThe XML C parser and toolkit of Gnome libxml-SAX.htmlSAX libxml-SAX.htmlNext this module implements a few function needed to process tree in an HTML specific way. 
Table of Contents
#define #HTML_COMMENT_NODEHTML_COMMENT_NODE #define #HTML_ENTITY_REF_NODEHTML_ENTITY_REF_NODE #define #HTML_PI_NODEHTML_PI_NODE #define #HTML_PRESERVE_NODEHTML_PRESERVE_NODE #define #HTML_TEXT_NODEHTML_TEXT_NODE void	#htmlDocContentDumpFormatOutputhtmlDocContentDumpFormatOutput 	( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding, 					 int format)void	#htmlDocContentDumpOutputhtmlDocContentDumpOutput 	( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding)int	#htmlDocDumphtmlDocDump 			(FILE * f, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  cur)void	#htmlDocDumpMemoryhtmlDocDumpMemory 		( libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size)void	#htmlDocDumpMemoryFormathtmlDocDumpMemoryFormat 		( libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size, 					 int format)const libxml-xmlstring.html#xmlCharxmlChar  *	#htmlGetMetaEncodinghtmlGetMetaEncoding 	( libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc)int	#htmlIsBooleanAttrhtmlIsBooleanAttr 		(const libxml-xmlstring.html#xmlCharxmlChar  * name) libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr 	#htmlNewDochtmlNewDoc 		(const libxml-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml-xmlstring.html#xmlCharxmlChar  * ExternalID) libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr 	#htmlNewDocNoDtDhtmlNewDocNoDtD 		(const libxml-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml-xmlstring.html#xmlCharxmlChar  * ExternalID)int	#htmlNodeDumphtmlNodeDump 			( libxml-tree.html#xmlBufferPtrxmlBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-tree.html#xmlNodePtrxmlNodePtr  cur)void	#htmlNodeDumpFilehtmlNodeDumpFile 		(FILE * out, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-tree.html#xmlNodePtrxmlNodePtr  cur)int	#htmlNodeDumpFileFormathtmlNodeDumpFileFormat 		(FILE * out, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding, 					 int format)void	#htmlNodeDumpFormatOutputhtmlNodeDumpFormatOutput 	( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding, 					 int format)void	#htmlNodeDumpOutputhtmlNodeDumpOutput 		( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-tree.html#xmlNodePtrxmlNodePtr  cur, 					 const char * encoding)int	#htmlSaveFilehtmlSaveFile 			(const char * filename, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  cur)int	#htmlSaveFileEnchtmlSaveFileEnc 			(const char * filename, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding)int	#htmlSaveFileFormathtmlSaveFileFormat 		(const char * filename, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 const char * encoding, 					 int format)int	#htmlSetMetaEncodinghtmlSetMetaEncoding 		( libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc, 					 const libxml-xmlstring.html#xmlCharxmlChar  * encoding)Description
Macro: HTML_COMMENT_NODE
#define HTML_COMMENT_NODEMacro. A libxml-SAX.html#commentcomment  in a HTML document is really implemented the same way as a libxml-SAX.html#commentcomment  in an XML document.
Macro: HTML_ENTITY_REF_NODE
#define HTML_ENTITY_REF_NODEMacro. An entity libxml-SAX.html#referencereference  in a HTML document is really implemented the same way as an entity libxml-SAX.html#referencereference  in an XML document.
Macro: HTML_PI_NODE
#define HTML_PI_NODEMacro. 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_NODEMacro. 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_NODEMacro. A text node in a HTML document is really implemented the same way as a text node in an XML document.
Function: htmlDocContentDumpFormatOutput
void	htmlDocContentDumpFormatOutput	( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-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 Function: htmlDocContentDumpOutput
void	htmlDocContentDumpOutput	( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-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 Function: htmlDocDump
int	htmlDocDump			(FILE * f, 					 libxml-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. Function: htmlDocDumpMemory
void	htmlDocDumpMemory		( libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size)Dump an HTML document in memory and return the libxml-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 Function: htmlDocDumpMemoryFormat
void	htmlDocDumpMemoryFormat		( libxml-tree.html#xmlDocPtrxmlDocPtr  cur, 					 libxml-xmlstring.html#xmlCharxmlChar  ** mem, 					 int * size, 					 int format)Dump an HTML document in memory and return the libxml-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 Function: htmlGetMetaEncoding
const libxml-xmlstring.html#xmlCharxmlChar  *	htmlGetMetaEncoding	( libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc)Encoding definition lookup in the Meta tags
doc: the document Returns: the current encoding as flagged in the HTML source Function: htmlIsBooleanAttr
int	htmlIsBooleanAttr		(const libxml-xmlstring.html#xmlCharxmlChar  * name)Determine if a given libxml-SAX.html#attributeattribute  is a boolean attribute.
name: the name of the libxml-SAX.html#attributeattribute  to check Returns: false if the libxml-SAX.html#attributeattribute  is not boolean, true otherwise. Function: htmlNewDoc
libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr 	htmlNewDoc		(const libxml-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml-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 Function: htmlNewDocNoDtD
libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr 	htmlNewDocNoDtD		(const libxml-xmlstring.html#xmlCharxmlChar  * URI, 					 const libxml-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 Function: htmlNodeDump
int	htmlNodeDump			( libxml-tree.html#xmlBufferPtrxmlBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-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 Function: htmlNodeDumpFile
void	htmlNodeDumpFile		(FILE * out, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-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 Function: htmlNodeDumpFileFormat
int	htmlNodeDumpFileFormat		(FILE * out, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-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. Function: htmlNodeDumpFormatOutput
void	htmlNodeDumpFormatOutput	( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-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 Function: htmlNodeDumpOutput
void	htmlNodeDumpOutput		( libxml-tree.html#xmlOutputBufferPtrxmlOutputBufferPtr  buf, 					 libxml-tree.html#xmlDocPtrxmlDocPtr  doc, 					 libxml-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 Function: htmlSaveFile
int	htmlSaveFile			(const char * filename, 					 libxml-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. Function: htmlSaveFileEnc
int	htmlSaveFileEnc			(const char * filename, 					 libxml-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. Function: htmlSaveFileFormat
int	htmlSaveFileFormat		(const char * filename, 					 libxml-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. Function: htmlSetMetaEncoding
int	htmlSetMetaEncoding		( libxml-HTMLparser.html#htmlDocPtrhtmlDocPtr  doc, 					 const libxml-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 ../bugs.htmlDaniel Veillard 
