|
libxml2
|
HTML documents. More...
Functions | |
| xmlDoc * | htmlNewDoc (const xmlChar *URI, const xmlChar *ExternalID) |
| Creates a new HTML document. | |
| xmlDoc * | htmlNewDocNoDtD (const xmlChar *URI, const xmlChar *ExternalID) |
| Creates a new HTML document without a DTD node if URI and publicId are NULL. | |
| const xmlChar * | htmlGetMetaEncoding (xmlDoc *doc) |
| Look up and encoding declaration in the meta tags. | |
| int | htmlSetMetaEncoding (xmlDoc *doc, const xmlChar *encoding) |
| Creates or updates a meta tag with an encoding declaration. | |
| void | htmlDocDumpMemory (xmlDoc *cur, xmlChar **mem, int *size) |
| Same as htmlDocDumpMemoryFormat with format set to 1 which is typically undesired. | |
| void | htmlDocDumpMemoryFormat (xmlDoc *cur, xmlChar **mem, int *size, int format) |
| Serialize an HTML node to a memory, also returning the size of the result. | |
| int | htmlSaveFile (const char *filename, xmlDoc *cur) |
| Serialize an HTML document to a file. | |
| int | htmlSaveFileEnc (const char *filename, xmlDoc *cur, const char *encoding) |
| Serialize an HTML document to a file. | |
| int | htmlSaveFileFormat (const char *filename, xmlDoc *cur, const char *encoding, int format) |
| Serialize an HTML document to a file using a given encoding. | |
| int | htmlNodeDump (xmlBuffer *buf, xmlDoc *doc, xmlNode *cur) |
| Serialize an HTML node to an xmlBuffer. | |
| int | htmlDocDump (FILE *f, xmlDoc *cur) |
| Serialize an HTML document to an open FILE. | |
| void | htmlNodeDumpFile (FILE *out, xmlDoc *doc, xmlNode *cur) |
| Same as htmlNodeDumpFileFormat with format set to 1 which is typically undesired. | |
| int | htmlNodeDumpFileFormat (FILE *out, xmlDoc *doc, xmlNode *cur, const char *encoding, int format) |
| Serialize an HTML node to an xmlBuffer. | |
| void | htmlNodeDumpOutput (xmlOutputBuffer *buf, xmlDoc *doc, xmlNode *cur, const char *encoding) |
| Same as htmlNodeDumpFormatOutput with format set to 1 which is typically undesired. | |
| void | htmlNodeDumpFormatOutput (xmlOutputBuffer *buf, xmlDoc *doc, xmlNode *cur, const char *encoding, int format) |
| Serialize an HTML node to an output buffer. | |
| void | htmlDocContentDumpOutput (xmlOutputBuffer *buf, xmlDoc *cur, const char *encoding) |
| Same as htmlDocContentDumpFormatOutput with format set to 1 which is typically undesired. | |
| void | htmlDocContentDumpFormatOutput (xmlOutputBuffer *buf, xmlDoc *cur, const char *encoding, int format) |
| Serialize an HTML document to an output buffer. | |
| int | htmlIsBooleanAttr (const xmlChar *name) |
| Determine if a given attribute is a boolean attribute. | |
HTML documents.
This modules implements functions to work with HTML documents, most of them related to serialization.
| void htmlDocContentDumpFormatOutput | ( | xmlOutputBuffer * | buf, |
| xmlDoc * | cur, | ||
| const char * | encoding, | ||
| int | format ) |
Serialize an HTML document to an output buffer.
| buf | the HTML buffer output |
| cur | the document |
| encoding | the encoding string (unused) |
| format | should formatting newlines been added |
| void htmlDocContentDumpOutput | ( | xmlOutputBuffer * | buf, |
| xmlDoc * | cur, | ||
| const char * | encoding ) |
Same as htmlDocContentDumpFormatOutput with format set to 1 which is typically undesired.
Use of this function is DISCOURAGED in favor of htmlDocContentDumpFormatOutput.
| buf | the HTML buffer output |
| cur | the document |
| encoding | the encoding string (unused) |
| int htmlDocDump | ( | FILE * | f, |
| xmlDoc * | cur ) |
Serialize an HTML document to an open FILE.
Uses the encoding of the document. If the document has no encoding, ASCII with HTML 4.0 named character entities will be used. This is inefficient compared to UTF-8 and might be changed in a future version.
Enables "formatting" unconditionally which is typically undesired.
Use of this function is DISCOURAGED in favor of htmlNodeDumpFileFormat.
| f | the FILE* |
| cur | the document |
Same as htmlDocDumpMemoryFormat with format set to 1 which is typically undesired.
Also see the warnings there. Use of this function is DISCOURAGED in favor of htmlDocContentDumpFormatOutput.
| cur | the document |
| mem | OUT: the memory pointer |
| size | OUT: the memory length |
Serialize an HTML node to a memory, also returning the size of the result.
It's up to the caller to free the memory.
Uses the encoding of the document. If the document has no encoding, ASCII with HTML 4.0 named character entities will be used. This is inefficient compared to UTF-8 and might be changed in a future version.
| cur | the document |
| mem | OUT: the memory pointer |
| size | OUT: the memory length |
| format | should formatting newlines been added |
Look up and encoding declaration in the meta tags.
The returned string points into attribute content and can contain trailing garbage. It should be copied before modifying or freeing nodes.
| doc | the document |
| int htmlIsBooleanAttr | ( | const xmlChar * | name | ) |
Determine if a given attribute is a boolean attribute.
This doesn't handle HTML5.
| name | the name of the attribute to check |
Creates a new HTML document.
| URI | system ID (URI) of the DTD (optional) |
| publicId | public ID of the DTD (optional) |
Creates a new HTML document without a DTD node if URI and publicId are NULL.
| URI | system ID (URI) of the DTD (optional) |
| publicId | public ID of the DTD (optional) |
Serialize an HTML node to an xmlBuffer.
Always uses UTF-8.
| buf | the HTML buffer output |
| doc | the document |
| cur | the current node |
Same as htmlNodeDumpFileFormat with format set to 1 which is typically undesired.
Use of this function is DISCOURAGED in favor of htmlNodeDumpFileFormat.
| out | the FILE pointer |
| doc | the document |
| cur | the current node |
| int htmlNodeDumpFileFormat | ( | FILE * | out, |
| xmlDoc * | doc, | ||
| xmlNode * | cur, | ||
| const char * | encoding, | ||
| int | format ) |
Serialize an HTML node to an xmlBuffer.
If encoding is NULL, ASCII with HTML 4.0 named character entities will be used. This is inefficient compared to UTF-8 and might be changed in a future version.
| out | the FILE pointer |
| doc | the document (unused) |
| cur | the current node |
| encoding | the document encoding (optional) |
| format | should formatting newlines been added |
| void htmlNodeDumpFormatOutput | ( | xmlOutputBuffer * | buf, |
| xmlDoc * | doc, | ||
| xmlNode * | cur, | ||
| const char * | encoding, | ||
| int | format ) |
Serialize an HTML node to an output buffer.
| buf | the HTML buffer output |
| doc | the document (unused) |
| cur | the current node |
| encoding | the encoding string (unused) |
| format | should formatting newlines been added |
| void htmlNodeDumpOutput | ( | xmlOutputBuffer * | buf, |
| xmlDoc * | doc, | ||
| xmlNode * | cur, | ||
| const char * | encoding ) |
Same as htmlNodeDumpFormatOutput with format set to 1 which is typically undesired.
Use of this function is DISCOURAGED in favor of htmlNodeDumpFormatOutput.
| buf | the HTML buffer output |
| doc | the document (unused) |
| cur | the current node |
| encoding | the encoding string (unused) |
| int htmlSaveFile | ( | const char * | filename, |
| xmlDoc * | cur ) |
Serialize an HTML document to a file.
Same as htmlSaveFileFormat with encoding set to NULL and format set to 1 which is typically undesired.
Use of this function is DISCOURAGED in favor of htmlSaveFileFormat.
| filename | the filename (or URL) |
| cur | the document |
| int htmlSaveFileEnc | ( | const char * | filename, |
| xmlDoc * | cur, | ||
| const char * | encoding ) |
Serialize an HTML document to a file.
Same as htmlSaveFileFormat with format set to 1 which is typically undesired. Also see the warnings there. Use of this function is DISCOURAGED in favor of htmlSaveFileFormat.
| filename | the filename |
| cur | the document |
| encoding | the document encoding |
| int htmlSaveFileFormat | ( | const char * | filename, |
| xmlDoc * | cur, | ||
| const char * | encoding, | ||
| int | format ) |
Serialize an HTML document to a file using a given encoding.
If filename is "-", stdout is used. This is potentially insecure and might be changed in a future version.
If encoding is NULL, ASCII with HTML 4.0 named character entities will be used. This is inefficient compared to UTF-8 and might be changed in a future version.
Sets or updates meta tags containing the character encoding.
| filename | the filename |
| cur | the document |
| format | should formatting newlines been added |
| encoding | the document encoding (optional) |
Creates or updates a meta tag with an encoding declaration.
NOTE: This will not change the document content encoding.
| doc | the document |
| encoding | the encoding string |