Hello,
I'm stuck writing a piece of software. I'm using Python 2.5 on WinXP Pro. I don't know how to get done what I need to do. I have some standardized input that looks like this:
This is the output of a parserprogram I'm working with. What I want to do is write these <items> into seperate files, where the filenames is the #UNIQUE ID#. I want to write these little files into a map with the date in it. So for a date that is 22/03/07 I want the item-files in 220307\<item>.x ml .
I've got no clue how to do this. I can copy the items to a new XML tree using ElementTree, but can't figure out how to extract the elements for the XML and use it in file/map naming. Could anybody give me some pointers?
I'm stuck writing a piece of software. I'm using Python 2.5 on WinXP Pro. I don't know how to get done what I need to do. I have some standardized input that looks like this:
Code:
<somename> <modulename> <item> <id>#UNIQUE_ID#</id> <datetime>yyyy-MM-dd hh:mm:ss</datetime> <title>#TEXT TITLE#</title> <description>#TEXT BODY#</description> <link>#LINK TO ARTICLE#</link> </item> </modulename> </somename>
I've got no clue how to do this. I can copy the items to a new XML tree using ElementTree, but can't figure out how to extract the elements for the XML and use it in file/map naming. Could anybody give me some pointers?
Comment