ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: XML, XSL, and Ant
Date Thu, 23 Oct 2003 08:27:25 GMT
On Wed, 22 Oct 2003, Kyle Adams <kadams@gfs.com> wrote:

> 1) <xmlcatalog> only applies to source XML document - if there are
> entities/dtds in the stylesheet, these can't be resolved by
> <xmlcatalog>.  Confirmed on Ant 1.5.3/Xalan 2.2, D11/Xerces 2.3.0
> and Ant 1.6, B2/Xalan 2.5.1/Xerces 2.5.0/10-22-2003 snapshot of
> commons-resolver.
> 
> 2) Any XML documents accessed via the document() function in the XSL
> will not have their entities/dtds resolved.  Confirmed on Ant
> 1.5.3/Xalan 2.2, D11/Xerces 2.3.0

I've read a thread (on general@xml or commons-dev@xml) that talked
about which resolver gets used under what circumstances.  You can set
the URIResolver at the TransformerFactory level as well as at the
Transformer level (and Ant should set it at both levels on my reading
of the code).

My JDK 1.4 javadocs (a bit outdated) state

,----
| is used by default during the transformation to resolve URIs used in
| xsl:import, or xsl:include.
`----

at TransformerFactory#setURIResolver and 

,----
| is used by default during the transformation to resolve URIs used in
| document(), xsl:import, or xsl:include.
`----

at TransformerFactory#getURIResolver - so it contradicts itself when
it comes to document().  I have no idea how it is implemented in
Xalan.

The methods in Transformer both state it would be used for document()
only.

Neither says anything about entities.

We set the catalog as entity resolver for the document explicitly but
currently use a StreamSource for the stylesheet which doesn't give us
a chance to plug in the entity resolver.

We should be able to change this if SAXSource is supported, I'll take
a stab at it - but I will need testers before I'm willing to merge my
changes into the 1.6 branch.  If I'd send you a changed ant-trax.jar,
could you test it in your Ant 1.6beta environment?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message