Hi,
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.
Code snippet:
sub getcXML {
use XML::LibXML;
my $resp_doc = XML::LibXML::Document->new();
my $root = $resp_doc->createElement('blah');
...
my $content = $resp_doc->toString;
return $content
}
The html is:
<form name="sndxml" method = "post" action =
http://someserver.com/process_xml>
<input type = "hidden" name = "xml_here" value = "[+ getcXML(); +]">
<input type = "submit" value = "Order">
</form>
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?
Anyone point me in the right direction?
Thanks,
Chris