[BangPypers] Access xml file form python script

Shashidhar P shashidhar85 at gmail.com
Tue Nov 2 09:17:43 CET 2010


Hi Avinash,
There is simple python library for parsing the XML file, accessing data,
adding, editing.
It is LXML. You can refer its documentation at: http://codespeak.net/lxml/.

On Tue, Nov 2, 2010 at 11:26 AM, Dhananjay Nene <dhananjay.nene at gmail.com>wrote:

> On Sun, Oct 31, 2010 at 5:12 PM, Avinash TM <avinashtm at gmail.com> wrote:
>
> > Hi All,
> >
> > I have created a simple xml document i.e., preferences.xml as follows
> >
> > <?xml version="1.0"?>
> > <object>
> >  <object name="category" value="cricket">
> >   <property name="title">Cricket</property>
> >   <property name="subscribers">
> >    <element name="avinash"/>
> > <element name="prashant"/>
> >   </property>
> >  </object>
> > </object>
> >
> >
> > My favourite light weight tool for xml is minidom
> http://docs.python.org/library/xml.dom.minidom.html
> <http://docs.python.org/library/xml.dom.minidom.html>
> http://www.boddie.org.uk/python/XML_intro.html
>
> If you are needing simple xml parsing capabilities - it might just suffice
> your needs and is built into python.
>
>
>
> > Now i want to access the above data from a python script.
> > I gone through some websites. But not getting actual idea.
> > Should i use any data structures ( Lists, Dictionary, Tuples) in my
> python
> > script.
> > Can anybody help me
> >
> > Thanks & Regards
> > Avinash
> > _______________________________________________
> > BangPypers mailing list
> > BangPypers at python.org
> > http://mail.python.org/mailman/listinfo/bangpypers
> >
>
>
>
> --
> --------------------------------------------------------
> blog: http://blog.dhananjaynene.com
> twitter: http://twitter.com/dnene
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
Regards,

Shashidhar N.Paragonda
shashidhar85 at gmail.com
+919449073835


More information about the BangPypers mailing list