Since XML regards whitespace as significant by default, you'd have to
define a DTD with a content model that describes what whitespace is
ignorable. The only problem is all of your documents must use that DTD.
Of course, you could always hack Xalan to throw whitespace away. That
would be fairly simple to do, but you'd be introducing non-standard
behavior.
Dave
"Murphy, James"
<James.Murphy@exce To: "'[EMAIL PROTECTED]'"
lergy.com> <[EMAIL PROTECTED]>
cc: (bcc: David N Bertoni/CAM/Lotus)
11/28/2001 05:37 Subject: Preventing whitespace text
nodes in
PM XalanSourceTreeDocument?
Please respond to
xalan-dev
Hi,
I'm looking for ways to improve the performance of processing rather large
instances (> 10MB). Currently takes ~ 1 minute on workstation type
hardware.
After profiling a bit I noticed most of the time is spent in a child of
XSLTEngineImpl::getSourceTreeFromInput namely parserLiaison.parseXMLStream.
I noticed a little deeper that XalanSourceTreeContentHandler::characters
maintains whitspace characters that end up being text nodes. I was
thinking
I'd like to drop them by preventing calls to m_document->createTextNode.
It
seems that would speed things up a lot since most of the time spent seems
to
be in node creation.
But I get the sneaking suspicion that I'm I missing the boat on something.
Is there another way to prevent the creation of whitspace nodes or any
other
low hanging fruit I'm not aware of?
Thanks
Jim