> I have an XML doc that I generated using XML::LibXML that needs to be
> included as a hidden form field in a form post.
>
> The problem is that the browser is encoding the XML doc.
>
> ie.
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE gtfd SYSTEM "http://gftd/schemas/data.dtd";>
>
> turns into:
> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
> &lt;DOCTYPE gtfd SYSTEM &quot;http://gftd/schemas/data.dtd&quot;&gt;
>
> which blows up in the parsing.  If I edit the result and swap back the <
> and " it works. How can I prevent the encoding of the XML data?

You have probably escaped the xml snippet twice yourself - check the code
of the page from your browser. If you see the value of your hidden field
as "&amp;lt;?xml...", you have done double escaping.

Just remove one of the escaping passes and it should work.

The browser isn't supposed to do any such encoding on its own. If it does
you need to change your browser. You aren't using Netscape 4.0, are you?

-- 
Antti Haapala

Reply via email to