Re: Help with XML processing using DOM



On Thu, 28 Jun 2007 18:57:39 -0400, Jeff Higgins wrote:
Also note that every Element node contains a Text node, so that Element
<b> is probably the next sibling of the Text node you're printing out.
Also when you print the value of this Text node it is equal to a single
whitespace because parser collapses all whitespace to a single space
unless you tell it not to.

Not necessarily. <br />'s don't contain any text nodes and writing
<a><b>Foo</b></a> gives a only one child: the b element.
.



Relevant Pages

  • Re: Help with XML processing using DOM
    ... is probably the next sibling of the Text node you're printing out. ... whitespace because parser collapses all whitespace to a single space ...
    (comp.lang.java.help)
  • Re: How-to: JavaScript trim() and normalize-space() functions
    ... Your regular expression saves the last whitespace character in a sequence. ... So, an earlier character could have been a new line, but might be replaced by a space. ... Conversely, the sequence could have been all spaces with the exception of a final new line, and it's that character that is saved. ... the alternative above would always replace a whitespace sequence with a single space. ...
    (comp.lang.javascript)
  • Re: spaces (and worse) in names ?
    ... replace any whitespace characterwith a single space. ... But this seldom matters in practice; we hardly need to rely on preservation of leading or trailing spaces. ...
    (comp.infosystems.www.authoring.html)
  • Re: XML DOM and Whitespace
    ... > previous sibling, not the first someChild node. ... It seems that PHP handles the whitespace as a node on ... That's also the correct behavior. ...
    (comp.lang.php)
  • Re: Unexpected whitespace following IMG tag
    ... There is a newline there; that whitespace becomes folded into a single space in the output. ... So, to remove the space, you need to have 0 whitespace between the img and div tags. ...
    (comp.infosystems.www.authoring.stylesheets)