[xml] serialization to UTF-16LE
- From: Kasimier Buchcik <kbuchcik 4commerce de>
- To: <xml gnome org>
- Subject: [xml] serialization to UTF-16LE
- Date: Mon, 03 Nov 2003 12:48:17 +0100
Hi,
I get different serialized results for text-nodes and attribute-values
if using "xmlSaveFormatFileTo" (note that I'm using values like "öäü?").
code snippet:
node = xmlNewDocNode(doc, NULL, "foo", NULL);
xmlDocSetRootElement(doc, node);
xmlSetProp(node, "bar", "öäü?");
chnode = xmlNewDocText(doc, "öäü?");
xmlAddChild(node, chnode);
handler = xmlFindCharEncodingHandler((const xmlChar*) "UTF-16LE");
[... ]
xmlSaveFormatFileTo(outbuffer, doc, (const xmlChar*) "UTF-16LE", 0);
The resulting xml:
<?xml version="1.0" encoding="UTF-16LE"?>
<foo bar="äöü">öäü?</foo>
The attribute value is escaped, the text-nodes value not.
Since I did not found anything in the specs that states, that attribute
values need to be excaped, although they *could* be serialized with the
stated encoding (UTF-16LE), I'm asking for help on information; did I
overlook something in the specs, or if this is a not intended bahaviour?
(Maby some context could be usefull: I'm just trying to implement (in
Delphi) the w3c's saveToString method of the DOMSerializer interface).
Thanks,
Kasimier Buchcik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]