preserveWhiteSpace and imported nodes dosn't work...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • R

    #1

    preserveWhiteSpace and imported nodes dosn't work...

    Hello everybody.

    I've got problem with preserving whitespaces:

    $doc->preserveWhiteS pace = 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::lo ad($pFileName);
    // new DomDocument change its whitespaces
    $tmpXml->preserveWhiteS pace = false;
    $tmpNode = $tmpXml->documentElemen t;
    $contents->appendChild($d oc->importNode($tm pNode, true)));

    has any one experienced this issue?

    firstChild, previousSibling are DOMText so I have to use
    getElementsByTa gName() 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
    R
Working...