[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: JAXP/TrAX: how to set parser for transforms?
> How does a Transformer know what XML parser to use? If you want it to use a definite parser, you can supply one as part of the SAXSource object. If you don't care, you can supply a StreamSource, and the choice is then up to the implementer. Saxon allows you to control the choice using setAttribute() on the TransformerFactory. At the next release it will use the JAXP javax.xml.parsers mechanism to define the fallback parser. > > If I want all the XML parsing to be done with a certain > parser, what do I do? In the case of Saxon, use setAttribute() on the TransformerFactory, once for the source document parser and once for the stylesheet parser. Xalan I think uses the javax.xml.parsers mechanism already. > > What if I want the parser for the main source document to be different > than the one used by document() and xsl:include? Then you need to supply each input in the form of a SAXSource that encapsulates its own parser. Note: JAXP is a little ambiguous as to whether the URIResolver should be used for the principal input files as well as secondary inputs. Saxon does, Xalan doesn't (I think). Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|