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

On Wed, Jan 14, 2004 at 05:28:55PM +0100, Kasimier Buchcik wrote:

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.
Are there any other possibilities to gain full control over the encoding 
declaration if serializing?

  There is far more simple. Redefine the encoding handler for the advertized
encoding declaration and provide the functions generating the bits you want !
user provided handler will override the default ones. And you won't have
to make all this mess or change the code.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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