>How wasteful is a SAX process that terminates after reading the root
The two expensive parts are instantiating the XML
parser and populating the stack trace in the exception object. Both costs can be
cut to near zero with careful Java programming.
Opening the file and reading the first bufferful of
content could also be expensive if the file is accessed over a
lost interest ... >I don't have much
I'm afraid those are psychological factors that I can't
really take into account when I make design recommendations.
How wasteful is a SAX process that terminates after reading the root
element node? It opens the file and reads the root element and its
attributes and then closes the file. Is that an expensive
The namespace problem presented itself as "stylesheet requires
attribute: version" when in fact the file had a version. It
took a day of research to figure out that the factory needed a boolean flag
set to true for this to work. Not at all intuitive.
When I got to the I/O exception when passing the DOMSource to the
transformer I lost interest in the approach. It wasn't til after the SAX
strategy was finished that I came to realize the base URI isn't set for a
DOMSource like it is automatically with a StreamSource.
I'm an XSL programmer more than a Java programmer. I don't
have much patience dealing with object oriented plumbing issues
like this. Document centric functional programming is so much easier for