|Subject:||Re: [saxon] wiring an EntityResolver into saxon|
|From:||Michael Kay (mi...@saxonica.com)|
|Date:||Jan 11, 2007 3:51:01 pm|
Basically, you construct a SAXSource object that contains an XMLReader object, having first called setEntityResolver() on the XMLReader to make it use your chosen EntityResolver. Then you pass the SAXSource as the input to Saxon, e.g. on the transform(source, result) method.
If the transformation reads additional source documents using functions such as doc() or document(), and you want your EntityResolver to be used on these, then you have two options:
(a) write a URIResolver which processes the supplied URI and returns a SAXSource constructed as above, or
(b) write your own implementation of XMLReader which is essentially just a wrapper around the "real" XMLReader, but which always sets the EntityResolver of the real XMLReader on initialization; then supply the name of your private XMLReader class to the method transformerFactory.setAttribute(FeatureKeys.SOURCE_PARSER_NAME, "your.xmlreader.class").
Michael Kay http://www.saxonica.com/
-----Original Message----- From: saxo...@lists.sourceforge.net [mailto:saxo...@lists.sourceforge.net] On Behalf Of pico Sent: 10 January 2007 19:43 To: saxo...@lists.sourceforge.net Subject: [saxon] wiring an EntityResolver into saxon
There is a lot of info in this forum about defining a custom EntityResolver class to resolve schemas, DTDs, entities, etc.
I'd like to code a simple EntityResolver used when transforming an XHTML document using XSLT. This is to prevent network trips during the transform. I understand from other threads here that SAXParser is doing the remote requests, not Saxon. But I don't understand how to tell saxon to tell SAXParser to use a custom EntityResolver.
How can this be wired up?
I have Saxon B 8.8.04.
-- View this message in context: http://www.nabble.com/wiring-an-EntityResolver-into-saxon-tf29 54703.html#a8264825 Sent from the saxon-help mailing list archive at Nabble.com.
----------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge &CID=DEVDEV
_______________________________________________ saxon-help mailing list saxo...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help