Access XML documents in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bogusbonafide
    New Member
    • Apr 2012
    • 2

    Access XML documents in C++

    this is the XML document i have:
    <?xml version="1.0" encoding="UTF-8" standalone="yes "?>
    <Root>
    <ConfigParams >
    <Param Name="1">1857</Param>
    <Param Name="2">10.31. 225.163</Param>
    <Param Name="3">5</Param>
    <Param Name="4">10.31. 225.163</Param>
    <Param Name="5">C:\</Param>
    </ConfigParams>

    <Requests>
    <Request>
    <RequestID>10 0</RequestID>
    <Host>host1</Host>
    <Parameters>
    <Param Name="RequestNu mber">1</Param>
    <Param Name="TimeOut"> 120</Param>
    </Parameters>
    </Request>

    <Request>
    <RequestID>10 1</RequestID>
    <Host>host2</Host>
    <Parameters>
    <Param Name="RequestNu mber">2</Param>
    <Param Name="TimeOut"> 120</Param>
    </Parameters>
    </Request>
    </Requests>
    </Root>


    Can you give me an idea of how to write a C++ code to access thing.
    (like we use JAXB in java)
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    here is a simple idea of parsing xml document.

    when you get a tag push it in to stack, when you get a enclosing tag pop it from stack.

    rest is up to you.

    Comment

    Working...