inder wrote:
> Is lxml part of standard python package ? I am having python 2.5 .
No, that's why I suggested ElementTree first.
> I might not be able to use any additional package other than the
> standard python . Could you please suggest something part of standard
> python package ?
No, there
On Aug 18, 11:24 am, Stefan Behnel wrote:
> inder wrote:
> > On Aug 17, 8:31 pm, John Posner wrote:
> >>> Use the iterparse() function of the xml.etree.ElementTree package.
> >>>http://effbot.org/zone/element-iterparse.htm
> >>>http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk
> >>> S
John Posner wrote:
>> Use the iterparse() function of the xml.etree.ElementTree package.
>
> iterparse() is too big a hammer for this purpose, IMO. How about this:
>
> from xml.etree.ElementTree import ElementTree
> tree = ElementTree(None, "myfile.xml")
> for elem in tree.findall('//book/titl
inder wrote:
> On Aug 17, 8:31 pm, John Posner wrote:
>>> Use the iterparse() function of the xml.etree.ElementTree package.
>>> http://effbot.org/zone/element-iterparse.htm
>>> http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk
>>> Stefan
>> iterparse() is too big a hammer for this pur
On Aug 17, 8:31 pm, John Posner wrote:
> > Use the iterparse() function of the xml.etree.ElementTree package.
>
> >http://effbot.org/zone/element-iterparse.htm
> >http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk
>
> > Stefan
>
> iterparse() is too big a hammer for this purpose, IMO. H
Use the iterparse() function of the xml.etree.ElementTree package.
http://effbot.org/zone/element-iterparse.htm
http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk
Stefan
iterparse() is too big a hammer for this purpose, IMO. How about this:
from xml.etree.ElementTree import E
inder wrote:
> I am new to xml . I need to parse the xml file . After reading and
> browsing on the web , I could get much help .
>
> I guess SAX would be better suited for my requirement .
That's a common misconception.
> Could some juct provide me a sample python code so that I can execute
>
Hi All,
I am new to xml . I need to parse the xml file . After reading and
browsing on the web , I could get much help .
I guess SAX would be better suited for my requirement .
Could some juct provide me a sample python code so that I can execute
it and see how the parsing actually happens .
Le