[xml] Problems with entities substitution

I know I'm propably doing something silly, but I'm stuck, and I need

The problem is like that: I create an XML document (with lixml2
API), and then I want to output it to file. Document contains
non ASCII characters. I set encoding to ISO-8859-2 (with UTF-8 it's the
same problem) and I want to have these characters plainly in my output.
But I always end up with character entities.

Here's my code:


        xmlDocPtr d = generateXML(); /* XML document with UTF-8 encoded
                                        strings */
        xmlSaveFormatFileEnc("output.xml", d, "ISO-8859-2", 1);

The output is something like that:

<?xml version="1.0" encoding="ISO-8859-2"?>
        <element attr="m&#xF3;zg"/>

When I put this document through xmllint, everything is ok:

        <element attr="mózg"/>

How to get rid of those entities? What am I doing wrong?


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