You need a simple xml parser. There are various degrees of XML: you could have a simple
xml header
xml definitions
or
xml header
dtd definitions
xml definitions
or
xml header
xlt definitions
xml definitions
If it is just the first form, it is quite easy. The others are more taxing as you need to store the allowable syntax to figure out where your data is. The basics are
1) Skip the header
2) get the tag.
3) if it begins with </, pop the stack. If there is nothing left, exit
4) if it is followed by another attribute with an = sign, save the attribute. Repeat until you get a > or a />
5) if you get a >, push it into a stack.
6) back to step 2 until end of file
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.