I`m using Visual C++ .NET but writting under Win32 API, and I wanna read from XML file. Is there any header or something that I can read data from XML file. THNX and sorry for so many posts. C ya
I`m using Visual C++ .NET but writting under Win32 API, and I wanna read from XML file. Is there any header or something that I can read data from XML file. THNX and sorry for so many posts. C ya
Butterfly sweep can make torando in another side of world
There's an activeX control with the progid of "Microsoft.XMLDOM"
You'd need to be confortable with COM and acitveX though
I don't think there's a standard win32 API for XML reading.
Too bad you're not using the .NET stuff, it's very easy with that.
google: c++ xml parser
gg
You could check out Microsoft's XML Parser and its SDK.
They are available as downloads from Microsoft's site.
Or, if you are processing simple XML files, you might want to check out TinyXML.
Hi there, so... If I will use TinyXML in my program, I must have .NET Framework version 1.1. on my computer?
Butterfly sweep can make torando in another side of world
Hi,
TinyXML does not need the .NET framework.
From its documentation page:
The URL is: http://www.grinninglizard.com/tinyxml/In brief, TinyXml parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved.
XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything.
There are different ways to access and interact with XML data. TinyXml uses a Document Object Model (DOM), meaning the XML data is parsed into a tree objects that can be browsed and manipulated, and then written back to disk. You can also construct an XML document from scratch with C++ objects and write this to disk (or another output stream.)
TinyXml is designed to be easy and fast. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example to get you started. It is released under the ZLib license, so you can use it in open source or commercial code.
It attempts to be a flexible parser, but with truly correct and compliant XML output (with the exception of the character set, below.) TinyXml should compile on any reasonably C++ system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support.
Best Regards,
Yeoh
--
Hi I started to use TinyXML parser, lear to read to .xml doc but I can`t read from it :/ for eg. I wanna read the value <x>50</x> how should I read that value that can assign 50 to integer? THNX C ya.
Butterfly sweep can make torando in another side of world
Hi,
TinyXML comes with an example program: xmltest.cpp.
You can get the value of a node like this: node->Value();
From xmltest example:
Best Regards,Code:node = doc.RootElement(); XmlTest( "Root element exists.", true, ( node != 0 && node->ToElement() ) ); XmlTest ( "Root element value is 'ToDo'.", "ToDo", node->Value()); node = node->FirstChild(); XmlTest( "First child exists & is a comment.", true, ( node != 0 && node->ToComment() ) ); node = node->NextSibling(); XmlTest( "Sibling element exists & is an element.", true, ( node != 0 && node->ToElement() ) ); XmlTest ( "Value is 'Item'.", "Item", node->Value() ); node = node->FirstChild(); XmlTest ( "First child exists.", true, ( node != 0 && node->ToText() ) ); XmlTest ( "Value is 'Go to the'.", "Go to the", node->Value() );
Yeoh
--