Do you have a question? Post it now! No Registration Necessary. Now with pictures!
February 12, 2005, 2:36 am
rate this thread
I am using tidy to clean up an xml file, but my problem is that it
replaces newlines with normal whitespaces.
Still worse is that if i retrieve text from the xml file it contains all
whitespaces tidy inserted to nicely render the file.
The xml files are generated and retrieved with an DomDocument.
preserveWhitespace is false.
At the time i am solving the problem with some regexps and string
replacements, but this way i have to think of all the weird
possibilities and i am sure i will forget one or two ;-)
So this is how my xml gets saved:
$xml = $dom->saveXML();
// Specify configuration
$config = array(
'indent' => true,
'input-xml' => true,
'output-xml' => true,
'wrap' => 200);
$tidy = new tidy;
$tidy->parseString($xml, $config, "utf8");
// write to the file
and how i load it:
$dom = new DomDocument();
$dom->preserveWhiteSpace = false;
The End of a long post
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum