Parsing XML with Python
- Status: Closed
- Prize: €30
- Entries Received: 2
- Winner: AurelianR
Contest Brief
We want the attached file parsed with Python.
The following data shall be parsed to variables and ready for printing to the console:
1) All elements included in <first>
Eg.
print idendifier
print issue-time-utc
.. and so on
2) A loop of all <area> elements included in <second>. The number of elements will change so it must loop all elements independent of the number of elements
The loop shall produce the following variables
a)data-period
*index
*start-time-local
*end-time-local
*start-time-utc
*end-time-utc
b)element (first item)
*type
*Number (marked as 5)
c)element (second item)
*type
*Number (marked as 8)
d)text
Eg.
print index
print start-time-local
.. and so on. This shall be done / looped for all area elements in the file (With the possiblity to read even more areas if included in the file.)
The python script must well commented and possible to edit without large changes if the xml layout is slightly modified.
Recommended Skills
Employer Feedback
“Delivery as expected, well done.”
mch0, Norway.
Public Clarification Board
How to get started with contests
-
Post Your Contest Quick and easy
-
Get Tons of Entries From around the world
-
Award the best entry Download the files - Easy!