Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAYou never know where one will come across an interesting challenge.
The following was posted as a response to a post called "XML Parsing for Beginners".
"I have a file (a sample is included below) that contains information about an item. My task is to generate a list that associates the item identifier to the specific attributes, for example from this sample, I'd be looking for something along this sort of output table:
item_identifier | grade_level | subject | Depth of Knowledge | Bloom's Taxonomy | etc etc"
So, basically a table that has all of the <source><langstring> as the title and the <taxon><entry> as the value. Then to make things a little more complex, when you get to the <source><langstring>Standard, there are multiples with the same name but different values, and I need all the values."
Looking forward to seeing other people's more... elegant... solutions but this seems to get the job done and match the output!
Here's my results. Haven't gotten to play too much with XML parsing, but I'm familiar with the structure of XML files.
I joined two XMLs child parses to reach the result.
This was my first time parsing XML. While I don't totally understand what's happening under the hood, I did get the answer with minimal Googling!
My output has the same records but in a slightly different order...