in reply to XML Parsing
Once that's fixed, a simple bit of work with XPath expressions will get you what you want. I posted some sample code for this a while back, here: Re: XPath command line utility....
If you want to try the script posted there, save it as "exp" somewhere in one of your PATH directories, make it executable, and run a command line like this:
(NB: I'm using a bash shell, where it's best to use single-quotes on the outside and double-quotes inside.) When I ran that on the (edited version of) the posted XML data, I got:exp -p '//Attribute[@name="Agreement ID"]/Value/@value | //Attribute[@name="Cycle code"]/Value/@value | //Attribute[@name="Subscriber ID list"]/Value/@value' your_file.xml
The first number is the "Agreement ID", the next is the "Cycle Code", and the rest are the "Subscriber ID list".15827134 1301 15846291 15613501
(The XPath expressions for this are a bit bulky, but once you grok the syntax, it's a lot easier than writing code.)
|
|---|