Actually, that's not raw data coming in, that's valid XML.
Why do you need to indent it? Just write it to a file.
If you really need to indent XML, get BeautifulSoup, read the
XML in with BeautifulStoneSoup, and write it back out with
prettify(). But if the next thing to see that XML is
On Jan 29, 8:54 pm, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Mon, 29 Jan 2007 23:42:07 -0300, [EMAIL PROTECTED] escribió:
For example the raw data is as follows
?xml version=1.0 ?BlahABCId id=1/DescriptionSomeText /
DescriptionResultPassorFail/Result/ABC/Blah
without spaces or new
on the
value of the attribute.. also i needed to display the output of the
http post in a more readable format..
That's straightforward. You confused people by asking the
wrong question. You wrote Convert raw data to XML, but what
you want to do is parse XML and extract data from
for a specific attribute and execute a set of commands based on the
value of the attribute.. also i needed to display the output of the
http post in a more readable format..
That's straightforward. You confused people by asking the
wrong question. You wrote Convert raw data to XML, but what
you
the file, look
for a specific attribute and execute a set of commands based on the
value of the attribute.. also i needed to display the output of the
http post in a more readable format..
That's straightforward. You confused people by asking the
wrong question. You wrote Convert raw
[EMAIL PROTECTED] wrote:
is there any other way to do this without using BeautifulStoneSoup..
using existing minidom or ext..
i dont want to install anything new
It appears that you already know the answer... Look at the minidom
documentation, toprettyxml method.
--
Gabriel Genellina
--
Hi
I am running a HTTP server which receives post from a process.
In my do_POST method am receiving raw data.
I know that this raw data has a valid XML content and I need to
convert this into an XML file.
Are there any routines to do this.. if not how to write one..
For example the raw data
On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote:
For example the raw data is as follows
?xml version=1.0 ?BlahABCId id=1/DescriptionSomeText /
DescriptionResultPassorFail/Result/ABC/Blah
without spaces or new lines. I need this to be written into an XML
file as
?xml version=1.0 ?
Blah
En Mon, 29 Jan 2007 23:42:07 -0300, [EMAIL PROTECTED] escribió:
For example the raw data is as follows
?xml version=1.0 ?BlahABCId id=1/DescriptionSomeText /
DescriptionResultPassorFail/Result/ABC/Blah
without spaces or new lines. I need this to be written into an XML
file as
[same