Php creates xml and formats the output.

Source: Internet
Author: User
Create xml in php and format the xml in DOMDocument. set $ dom-& gt; formatOutput & nbsp; true; however, only the first-level node under the root node is formatted, and the child node under the first-level node is not (). What I want is to format the output of the entire xml file (): php creates the xml file and formats the output.
DOMDocument creates xml and sets $ dom-> formatOutput to true. However, only the first-level node under the root node is created and formatted, the subnode under the first-level node does not (). What I want is that the entire xml file is formatted and output ()
:

:

Share To: formatOutput? =? True; but only the first node under the root node is formatted, and the child node under the first node is not ().... 'Data-pics = '/img/2013/07/01/125924297 .png |/img/2013/07/01/125924298 .png'>


------ Solution --------------------
Paste your code.
------ Solution --------------------
Use tidy
This is the gospel of html/xml. it is worthwhile to take some time to understand it.

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.