What is the best way to parse XML?
I am wondering if OO has some easy way to parse simple XML file, or string?
All I need is get result like:
I know I can strip all content by something, but looking for ready way.
Have you tried to use the XPath Evaluator or XPath Query operations?
Other useful XML operations are located under XML Processing folder.
Hope it helps,
If there is any namespaces in your xml, you can not parse your xml string. I am not sure but OO9.02(with content patches 9_00_06) uses XPATH 1.0 version for XPATH evaluator. If you want to parse XML with namescapes first you should remove the namespaces from xml string using regular expression.
Thanks. So, thus to parse entire XML I have to know the structure of it, right?
How about get it parsed without such knowledge?
Other words: if XML is some config file of something, is it possible at all to get all variables and its values?
It does not matter if it's a config file or a return string from webservice. You can get all values if you know the structure(I mean paths).
I am waiting for the new patch for JSON format, so hopefully I will be parsing any XML string in OO without using workarounds.