4
w3coded manual dom
w3coded manual dom
Your question would w3coded manual dom be a lot more legible if it were formatted w3coded manual dom correctly. And honestly, clicking the "code" w3coded manual dom button would have been far easier on your end w3coded manual dom than replacing all the angle-brackets with HTML w3coded manual dom entities and double-spacing everything.
w3coded manual dom
– Anon.
w3coded manual dom
Jul 1 '10 at 4:10
w3coded manual dom
,Then, even ignoring white space, w3coded manual dom you have to realize the whitespace inside the w3coded manual dom
ie:
$dom = new DomDocument();
$dom->formatOutput = true;
$dom->preserveWhiteSpace = false;
$dom->load($myxmlfile);
Perfect solution. It's working. Here is the code that I have used:
//create new document object
$dom_object = new DOMDocument();
//load xml file
$xml_file_path = get_template_directory()."/flash/playlist.xml";
$dom_object->formatOutput = true;
$dom_object->preserveWhiteSpace = false;
$dom_object->load($xml_file_path);
Your code gives me this:
<?xml version="1.0" encoding="UTF-8"?>
<body>
<seg>
text 1
</seg>
<seg> text 2 </seg></body>
If you say $dom->preserveWhiteSpace = false;
:
<?xml version="1.0" encoding="UTF-8"?>
<body>
<seg>
text 1
</seg>
<seg> text 2 </seg>
</body>
The tags are indented, but libxml still cannot do this:
<?xml version="1.0" encoding="UTF-8"?>
<body>
<seg>
text 1
</seg>
<seg>
text 2
</seg>
</body>
Last Update : 2023-09-22 UTC 12:42:38 PM
Last Update : 2023-09-22 UTC 12:42:30 PM
Last Update : 2023-09-22 UTC 12:42:20 PM
Last Update : 2023-09-22 UTC 12:42:05 PM
Last Update : 2023-09-22 UTC 12:41:46 PM
Last Update : 2023-09-22 UTC 12:41:30 PM
Last Update : 2023-09-22 UTC 12:41:12 PM