Read the xml file with Qt, and the program runs to if (! Doc. setContent (& amp; file) error, xmldoc. setcontent

Source: Internet
Author: User

Read the xml file with Qt, and the program runs to if (! Doc. setContent (& file) error, xmldoc. setcontent

Look at hoyafei's <Qt Creator Quick Start>, and then read the xml file using the example of writing the DOM.

At first, everyone thought that there was a problem with their path. In fact, there was no problem with the open before. How could this problem happen later? (I made a lot of turns here)

To understand the principles of this function in other ways, you can create a tree and save the data in xml format to a doc with the same tree structure. That is to say, we encountered an error when creating this tree. After locating the tree, we can see if our XML file is wrong.

For another xml file, click it online and compare it to find the original line <? Xml version = "1.0" encoding = "UTF-8"?> There cannot be spaces on either side of the question mark!

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.