How to parse an XML element which has keys and values separated by colons and newlines?

Question:

I am currently working on a project where I have to get information out of a lot of XML Documents. Each document has an element header_text. There are a lot of values in there, which looks like that:

<header_text>
key1: val1
key2: val2
key3: val3
</header_text>

The keys are the same in each document, the values are sometimes empty.
I have a strong feeling that this is not standard XML, but I’m probably wrong?
Has anyone an idea how to parse these values quick and simple?

edit: I’m on python

Asked By: chefhose

||

Answers:

Maybe you can use python and elementTree module to parse it:
https://docs.python.org/3.4/library/xml.etree.elementtree.html#tutorial

Answered By: Berhu
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.