This is a neat solution. You can parse any well-formed general
entitity (e.g. Anil's document with multiple root nodes) in 4Suite
1.0a4:
from Ft.Xml.Domlette import EntityReader
s = """
eggs
more eggs
"""
docfrag = EntityReader.parseString(s, 'http://foo/test/spam.xml')
docfrag is now ready for
William Park wrote:
> [EMAIL PROTECTED] wrote:
> > Hi,
> >
> > I wanted to write a script that will read the below file:
> >
> >
> > .
> >
> >
> >
> > ..
> >
> > ..
> >
> >
> >
> > ..
> >
> > ..
> >
> > ..
> >
> > .
> > .
> >
> > .
> >
> >
> >
> > ..
> >
> >
> >
> > ..
> >
>
[EMAIL PROTECTED] wrote:
> Hi,
>
> I wanted to write a script that will read the below file:
>
>
> .
>
>
>
> ..
>
> ..
>
>
>
> ..
>
> ..
>
> ..
>
> .
> .
>
> .
>
>
>
> ..
>
>
>
> ..
>
>
>
>
>
> ..
> and so on
>
> The output of the script shud be
>
> ABC
> ..EFGA
>
<[EMAIL PROTECTED]> wrote:
>
>
> .
> .
>
>
>
> ..
> and so on
an XML document can only have a single root element, but your example
has at least two top-level elements (abcd and xyz).
here is some elementtree code that handles this by wrapping your data in
a "root" element.
from elementtr
On Thu, 09 Dec 2004 06:00:27 -0800, Anil wrote:
>
> Thomas Guettler wrote:
>> Hi,
>>
>> Here is an example how to use sax:
>>
>> http://pyxml.sourceforge.net/topics/howto/node12.html
>>
>> Thomas
>>
>> --
>> Thomas GÃttler, http://www.thomas-guettler.de/
>
>
> Could you please tell me how to a
Anil wrote:
> Could you please tell me how to achieve the below.
> I am interested in getting the output like:
>
> ABC
> EFGA --> child of ABC
> ABDG --> child of AEFGA
> MON --> child of ABC
> A1
> FGA --> child of A1
> BG--> child of FGA
print """
ABC
EFGA --> child of
Thomas Guettler wrote:
> Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby:
>
> > Hi,
> >
> > I wanted to write a script that will read the below file:
>
> Hi,
>
> Here is an example how to use sax:
>
> http://pyxml.sourceforge.net/topics/howto/node12.html
>
> Thomas
>
> --
> Thomas Güttler, http
Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby:
> Hi,
>
> I wanted to write a script that will read the below file:
Hi,
Here is an example how to use sax:
http://pyxml.sourceforge.net/topics/howto/node12.html
Thomas
--
Thomas Güttler, http://www.thomas-guettler.de/
--
http://mail.pyt
Hi,
I wanted to write a script that will read the below file:
.
..
..
..
..
..
.
.
.
..
..
..
and so on
The output of the script shud be
ABC
..EFGA
ABDG
..MON
A1
..FGA
BG
Please help me in writing a Python script for the above task.
Regards,
Anil.
--
h