Do you have a question? Post it now! No Registration Necessary. Now with pictures!
February 20, 2005, 2:36 pm
rate this thread
I've got problem with preserving whitespaces:
$doc->preserveWhiteSpace = false;
works fine up to the point when I try to load external XML file.
// up to this point whitespaces are OK
// load new DomDocument
$tmpXml = DomDocument::load($pFileName);
// new DomDocument change its whitespaces
$tmpXml->preserveWhiteSpace = false;
$tmpNode = $tmpXml->documentElement;
has any one experienced this issue?
firstChild, previousSibling are DOMText so I have to use
getElementsByTagName() which is much slower...
especially when I know that the node I'm interested in
is firstChild (XSD schema)
when I saveXML I can see that nodes that were imported have
whitespaces and the rest of my saved document is space-free
thanks in advance for Your help