C ++ xml parsing tool-tinyxml Graphic Solution

Source: Internet
Author: User

In my previous blog, I mentioned parsing xml as a real java program. The xml parsing methods in java include dom and sax. I am used to dom. When c ++ first came into contact with xml, I must use inertia and Lenovo thinking.
There are many xml parsing methods in c ++. Here, I would like to explain the simplest and most convenient tinyxml method as convenient as Dom.


TinyXML is an open-source parsing XML library that can be used in C ++ and compiled in Windows or Linux. The parsing library's model parses the XML file and then generates the DOM model in the memory, so that we can easily traverse this XML tree.

The DOM model is a Document Object Model. It divides a document into multiple elements (such as books, chapters, sections, and segments ), the tree structure is used to represent the ordered relationship between these elements and the nested inclusion relationship.
 


By looking at the source code, you can query the classes required in TinyXML and the relationships between classes. By understanding this, we can make development easier.

The relationships between classes are as follows:

Understanding the relationship between them not only facilitates development, but also solves the following questions about tinyxml.
 
Usage: Download The tinyxml source code or corresponding dll on the official website. During development, I use the tinyxml source code, which is very convenient. We recommend that you use the tinyxml source code. You only need to import tinyxml. h, tinystr. h, tinystr. cpp, tinyxml. cpp, tinyxmlerror. cpp, and tinyxmlparser. cpp into the project to use it.
In the next blog, we will operate xml based on tinyxml.

Related Article

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.