note 102343 added to class.domdocument

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Just to add to tloach's comment, the formatOutput bug does not save HTML formatting properly. 

So if you're trying to save HTML a simple fix is to go ahead and still set the formatOutput to true and save as XML, but then strip the XML tag.

<?php
...

$document->formatOutput = true;

$output = $document->saveXML();

$output = str_replace('<?xml version="1.0"?>',null,$output);

echo $output;

?>

This will actually do you a favor if you want XHTML instead of HTML 4.01.
----
Server IP: 192.41.42.26
Probable Submitter: 24.35.53.237
----
Manual Page -- http://www.php.net/manual/en/class.domdocument.php
Edit        -- https://master.php.net/note/edit/102343
Del: integrated  -- https://master.php.net/note/delete/102343/integrated
Del: useless     -- https://master.php.net/note/delete/102343/useless
Del: bad code    -- https://master.php.net/note/delete/102343/bad+code
Del: spam        -- https://master.php.net/note/delete/102343/spam
Del: non-english -- https://master.php.net/note/delete/102343/non-english
Del: in docs     -- https://master.php.net/note/delete/102343/in+docs
Del: other reasons-- https://master.php.net/note/delete/102343
Reject      -- https://master.php.net/note/reject/102343
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.