Generating HTML containing XML in an INPUT tag

bendorge at bendorge at
Sat Mar 17 08:09:25 CET 2007

Hi there,

Using Python, I'm auto-generating an HTML file that contains:
<input type="hidden" value="XXX" />, where XXX is XML data (encoded

Articles regarding unicode are making my head spin! Is there a way to
encode XML file contents to a hexadecimal string that could be decoded
on a PHP server?

I have an XML file that is generated based on user entries (GUI from

After the XML file is created, I want the user to see an HTML preview,
and then click an Upload button on the page. Hidden in the page is the
tag I showed above.

I decided not to generate <input type="file" /> because from a
usability standpoint, I want the user to create this file and upload
it to my PHP server in as few steps as possible. Also, I tried setting
the value to the XML file browser security settings don't
like it and I'm sure other browsers won't like it either.

Any ideas?

More information about the Python-list mailing list