You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by ma...@ubs.com on 2000/10/18 14:03:07 UTC

document()

Tracing through jungles of Xalan and Xerces source code this morning, I
think I've 
finally figured out why I get the weak error messages that I do when I
parse an XML document through an XSL stylesheet (using XALAN/XERCES).

I believe that it all has to do with the use of the "document()"
function!

It seems that when this function is found by the processor (then created
by XPathFactory and 
installed by Stylesheet), the FuncDocument class is called. This class
has a 
method getDoc (throws org.xml.sax.SAXException) which gets the document
referenced in the 
document() function, parses it through help of the XMLParserLiaison
class 
(bridge between XSLT and XML parser), and catches any parser exception
with a 
simple (too simple in my opinion) message "XSL Warning: Can not load
requested 
doc:"

It would be much better, I believe, if the standard SaxException error
messages (they are very good, I might add) were output instead of this
default "XSL Warning: Can not load requested doc: (filename)" which,
though occasionally stating where the problem is (line and column
number), doesn't say what the problem was!

I am creating a "style-free" structure for the stylesheets linked to the
servlet I am working on and am using this useful document() function to
do it (as suggested in the article found at
http://www.xml.com/pub/2000/07/26/xslt/xsltstyle.html ).

I would very much appreciate any suggestions/comments that you may have.

Thanks in advance,

Marc