Xml c ++ operations

Source: Internet
Author: User

[It168 technical documentation] You may be surprised to see this title, because up to now, I am afraid not many people have used XML documents.
However, if you are a user of native code in vc6 or vc7, I think you may have some interest.

There is no class for XML operations in MFC. If it is a loyal com supporter, you can use Microsoft's MSXML Dom to operate an XML file.
If it is open-source or cross-platform support, you can choose to use WFC, xml4c, and Apache's famous xerces C ++ for operations, using these class libraries, you can easily and efficiently read and write XML files. The latest XML standards are also supported.

However, do not forget one thing. Basically, some configuration files, such as Visual Studio, need to use VC to read and write XML files.. Net project files. The size of such files is generally limited to a certain capacity. If we use any of the above methods, we need to download a library file of several MB or even 10 MB. It is really a bit uneconomical.

Thanks to SourceForge and Google for providing us with enough resources to simplify our development. Here I will introduce you to a short and concise XML Parse class ---- tinyxml, tinyxml is not only short, the efficiency is also very high, and using this class can quickly locate the node we need to locate in XML. It provides a method called tixmlnode * firstchild (const STD: string & _ value) to read and write the XML file nodes in the simplest way.

After practice, we found that the speed of reading and writing XML in this class is still very good. If we say the disadvantage, there are some bugs in Unicode support. For example, there is a bug in the explanation of the XML tag below.

 <Filter Name = "program" filter = "CPP; C; cxx; def; odl; IDL; HPJ; BAT; ASM; asmx">

However, if you change

<Filter Name = "program file" filter = "CPP; C; cxx; def; odl; IDL; HPJ; BAT; ASM; asmx">
 

Then, you can. 1 http://www.jclark.com/xml/expat.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.