Re: [xml] How to parse and print data

On 10/13/2010 04:58 PM, samaram s wrote:
Hi, Thank you for the link.
Actually i have gone through those sample codes. None of them dealt with
getting the value given a node.
Suppose, provided node as "Prompt" i should able to print the Value,
"System Language" in the below example.
There are lots of API's. unable to locate which one to use.
Could you please give me some idea on it.

That's the "content" of the node, look for the api routines whose names look like GetContent. Really, all this is well documented with loads of examples.

You might want to consider using xpath to extract information out of your documents, it's easy to use and very powerful. Plus it isolates you from a lot of the low level stuff.

     > <?xml version="1.0" encoding="UTF-8"?>
     > <!--Created on Date and Time -->
     > <script>
     > <Question Token="01" Offset="00" Width="02" >
     > <Prompt>SYSTEM LANGUAGE</Prompt>
     > <Option Value="00">English</Option>
     > <Option Value="01">French</Option>
     > <Value>00</Value>
     > </Question>
     > </script>
John Dennis <jdennis redhat com>

Looking to carve out IT costs?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]