[Bug 728837] New: Review Request: xml2dict - Use attributes of dictionary to access xml elements.

bugzilla at redhat.com bugzilla at redhat.com
Mon Aug 8 05:31:05 UTC 2011


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.

Summary: Review Request: xml2dict - Use attributes of dictionary to access xml elements.

https://bugzilla.redhat.com/show_bug.cgi?id=728837

           Summary: Review Request: xml2dict - Use attributes of
                    dictionary to access xml elements.
           Product: Fedora
           Version: rawhide
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: medium
          Priority: medium
         Component: Package Review
        AssignedTo: nobody at fedoraproject.org
        ReportedBy: yuwang at redhat.com
         QAContact: extras-qa at fedoraproject.org
                CC: notting at redhat.com,
                    package-review at lists.fedoraproject.org
    Classification: Fedora
      Story Points: ---
              Type: ---


Spec URL: http://yuwang.fedorapeople.org/xml2dict.spec

Description: Use attributes of dictionary to access xml elements.

Example as below:
from xml2dict import XML2Dict

if __name__ == '__main__':
    s = """<?xml version="1.0" encoding="utf-8" ?>
    <result>
        <count n="1">10</count>
        <data><id>491691</id><name>test</name></data>
        <data><id>491692</id><name>test2</name></data>
        <data><id>503938</id><name>hello, world</name></data>
    </result>"""

    xml = XML2Dict()
    r = xml.fromstring(s)
    from pprint import pprint
    pprint(r)
    print r.result.count.value
    print r.result.count.n

    for data in r.result.data:
        print data.id, data.name 
    pprint(xml.parse('a'))

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the package-review mailing list