[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?

Subject: RE: JAXP/TrAX: how to set parser for transforms?
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 25 Apr 2001 08:51:56 +0100
setting the parser in jaxp
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.