XML : Create a subset of an xml file using python

I am looking to create a subset of an xml file using python for testing. In the example xml below I would like to extract all records with an item date of "January 2015" and create a new xml file with just these records. any help would be much appreciated!

  <config>    <item date="January 2015">      <mode>1</mode>      <current>1</current>    </item>    <item date="February 2016">      <mode>9</mode>      <current>100</current>    </item>    <item date="January 2015">      <mode>9</mode>      <current>100</current>    </item>  </config>     

No comments:

Post a Comment