J
jack
Hi all,
I am working on perl..and am using XML::Simple to parse a xml document.
I've been trying to retrieve character data from tags whose occurance
is recursive.. The scenario can be better explained as below:
For a structure like,
<employees>
<employee>
<name>John Doe</name>
<age>43</age>
<sex>M</sex>
<department>Operations</department>
</employee>
</employees>
To access the value "John Doe", we can use the syntax:
$data->{employee}->[0]->{name} {$data is a XML::Simple variable}
But, how do I access the character data between the tags..when the tag
structure of the XML is as shown below..and tagging structure changes
with the document and is not standard, is there a function or
module..or technique..which works recursively..depending on the nested
tagging structure of the XML document and retrieves the character data
located in the lowest level of the nesting?
How do the access all the data from this structure?
<outline>
<item>
<item>Proteins and Phospholipid Measurements</item>
<item>comprehension requirements</item>
</item>
<item>
<item>educational communication.</item>
<item>
<item>traditional classroom.</item>
<item>peers around the world.</item>
</item>
</item>
</outline>
Jack
I am working on perl..and am using XML::Simple to parse a xml document.
I've been trying to retrieve character data from tags whose occurance
is recursive.. The scenario can be better explained as below:
For a structure like,
<employees>
<employee>
<name>John Doe</name>
<age>43</age>
<sex>M</sex>
<department>Operations</department>
</employee>
</employees>
To access the value "John Doe", we can use the syntax:
$data->{employee}->[0]->{name} {$data is a XML::Simple variable}
But, how do I access the character data between the tags..when the tag
structure of the XML is as shown below..and tagging structure changes
with the document and is not standard, is there a function or
module..or technique..which works recursively..depending on the nested
tagging structure of the XML document and retrieves the character data
located in the lowest level of the nesting?
How do the access all the data from this structure?
<outline>
<item>
<item>Proteins and Phospholipid Measurements</item>
<item>comprehension requirements</item>
</item>
<item>
<item>educational communication.</item>
<item>
<item>traditional classroom.</item>
<item>peers around the world.</item>
</item>
</item>
</outline>
Jack