CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Question How do I parse an XML file?

    Good morning,

    I've been trying with various libraries (everything from pugixml to RapidXML) but have been unable to parse a simple XML file.

    My RapidXML attempt: https://ideone.com/XWylb

    My pugiXML attempt: https://ideone.com/RzN6X

    XML file: https://ideone.com/wrG13

    Can you help me get one to work?

    Thanks for all suggestions,

    Alec Taylor

    PS: Preferably I would like the RapidXML one to work.

  2. #2
    Join Date
    Nov 2011
    Posts
    4

    Re: How do I parse an XML file?

    My tinyXML attempt: https://ideone.com/yC1l8

    (still not working)

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: How do I parse an XML file?

    If 3 different XML libraries have failed to parse this XML file, is it possible the file does not contain valid XML?

  4. #4
    Join Date
    Nov 2011
    Posts
    4

    Re: How do I parse an XML file?

    Quote Originally Posted by Lindley View Post
    If 3 different XML libraries have failed to parse this XML file, is it possible the file does not contain valid XML?
    I have included a copy of the XML, if you believe that to be the case, please attempt analysis yourself.

  5. #5
    Join Date
    Aug 2008
    Posts
    902

    Re: How do I parse an XML file?

    Your TinyXML implementation works just fine if you fix your type switching. It should be TiXmlNode::TINYXML_DOCUMENT not TiXmlNode::DOCUMENT, same with the others.

  6. #6
    Join Date
    Nov 2011
    Posts
    4

    Re: How do I parse an XML file?

    Figured out the rapidxml version.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured