You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brett Bergquist <bb...@snet.net> on 2000/11/28 01:06:52 UTC

Migrating code that uses xml-tr to the new xml parser

I tried running my Tomcat 3.1 code that uses the xml-tr package with Tomcat
3.2Beta7 with no success.  Any of my code that parsed XML documents failed
under 3.2.  After further investigation, I've determined what the problem
is.  With the Sun parser/dom implementation that comes with xml-tr,
ignoreable whitespace is ignored by default.  This means that you will not
see Text nodes that are just whitespace that is used for document formating
within the DOM model.  With the xml package with 3.2, the default is just
the opposite; ignorable whitespace is not ignored and shows up as Text
nodes.  If you've written your DOM processing code not to expect Text nodes
that represent ignoreable whitespace, your code will fail miserably.  If you
get a hold of the XmlDocumentBuilder instance, you can call
setIgnoringLexicalInfo(true) to get back the old behavior.

Just in case someone else runs into this problem.