[xml] "Control over encoding declaration (prolog and meta)"



Hi,

I'm trying to serialize documents to UTF-16LE, with full control over 
the prolog - I need the encoding declaration to differ from the target 
encoding. Doing so I used the static function "xmlDocContentDumpOutput" 
as a template, the prolog is constructed and "xmlNodeDumpOutput" is 
called (with the target encoding) on every child of the document node. 
It works all fine except for one case: if the document is a XHTML 
document, "xmlNodeDumpOutput" calls "xhtmlNodeDumpOutput", this sets the 
meta encoding (with "htmlSetMetaEncoding") to the target encoding. Here 
I lose the control over the declared encoding.

So I'm asking if there could be added a function like the following:

void
xmlNodeDumpOutputEncDecl(xmlOutputBufferPtr buf, xmlDocPtr doc, 
xmlNodePtr cur, int level, int format, const char *encoding, const char 
*encodingDecl)

The only differnce to "xmlNodeDumpOutput" would be that 
"htmlSetMetaEncoding" would be called with @encodingDecl rather than 
@encoding.

Are there any other possibilities to gain full control over the encoding 
declaration if serializing?


Greetings,

Kasimier




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]