Thats what is wierd. I don't do any escaping. I think it might be embperl doing the escaping because if I do a print of the XML doc string it has no escaping. If I put the string between [+ $content +] then it gets escaped.
Thanks for your help, Chris ----- Original Message ----- From: "Antti Haapala" <[EMAIL PROTECTED]> To: "Chris Pizzo" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, November 01, 2002 6:35 AM Subject: Re: Novice - Problem with data encoding > > > 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: > > <?xml version="1.0" encoding="UTF-8"?> > > <DOCTYPE gtfd SYSTEM "http://gftd/schemas/data.dtd"> > > > > 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 "&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 > >