preserveWhiteSpace and imported nodes dosn't work...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hello everybody.

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;
$contents->appendChild($doc->importNode($tmpNode, true)));

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
best regards

Site Timeline