Re: [xml] "Control over encoding declaration (prolog and meta)"
- From: Daniel Veillard <veillard redhat com>
- To: Kasimier Buchcik <kbuchcik 4commerce de>
- Cc: xml gnome org
- Subject: Re: [xml] "Control over encoding declaration (prolog and meta)"
- Date: Wed, 14 Jan 2004 12:27:43 -0500
On Wed, Jan 14, 2004 at 05:28:55PM +0100, Kasimier Buchcik wrote:
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.
[...]
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 !
http://xmlsoft.org/html/libxml-encoding.html#xmlNewCharEncodingHandler
and
http://xmlsoft.org/html/libxml-encoding.html#xmlRegisterCharEncodingHandler
user provided handler will override the default ones. And you won't have
to make all this mess or change the code.
http://xmlsoft.org/encoding.html#extend
Daniel
--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]