> From: Karl Guertin
> Subject: Combine TG and Subway?
> 
> <script src="foo.js"></script>
> 
> and
> 
> <script src="foo.js"> </script>
> 
> Are not the same. The latter has a text node inside the script element
> consisting of a single space (unless I'm remembering my xml
> incorrectly).

Actually, an element node that's not defined to allow mixed content (tags +
text) and contains only white space (or comments and processing
instructions) is the same as an empty node, for the purposes of validation. 

If just happens that Kid doesn't strip the space, which is why that example
works, but if all the tag contains is white space, and the tag isn't
declared as having mixed content, then technically the white space is
ignorable. 

That's why it's better for the HTML serializer to deal with these issues
(because it knows the rule that scripts tags should always have their end
tag written out instead of abbreviated), instead of trying to trick the XML
processor into doing what you want (which only works with some processors,
some of the time). 

http://www.cafeconleche.org/books/xmljava/chapters/ch06s10.html

        -Don


Reply via email to