[BangPypers] Access xml file form python script

Pradeep Gowda pradeep at btbytes.com
Sun Oct 31 20:24:18 CET 2010


On Sun, Oct 31, 2010 at 7:42 AM, 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>

This looks like xml generated by a Microsoft product, and not by/for a human..

How is this better than:

<options>
 <category name="cricket" title="Cricket">
  <subscribers>
    <subscriber name="Avinash" />
    <subsriber name="Prashanth" />
  </subscribers>
 </category>
</options>

Why create child nodes when attributes are sufficient?

+PG


More information about the BangPypers mailing list