[Yanel-dev] URI resoving patch for BasicXMLResource
Evaldas Taroza
etaroza at optaros.com
Fri Mar 7 09:15:17 CET 2008
Michael Wechner wrote:
> Josias Thöny wrote:
>
>> Evaldas Taroza wrote:
>>
>>> This solves the problem, that with BasicXMLResource the
>>> <xsl:include href="yanelrepo:/xslt/my.xsl">
>>> Did not work.
>>
>>
>> I applied your patch, thank you very much.
>> Finally we are able to re-use xslt code.
>
>
> that's great indeed. I assume it also works for
>
> <xsl:import href=".."/>
>
> Maybe some documentation on this would be nice ;-)
Yes, it should work for xsl:import as well. I think it is natural to
have the same resolver for href as well as for document().
Evaldas
>
> Thanks very much
>
> Michi
>
>>
>> josias
>>
>>>
>>> Evaldas
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Index: impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
>>> ===================================================================
>>> --- impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
>>> (revision 32696)
>>> +++ impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
>>> (working copy)
>>> @@ -235,14 +235,16 @@
>>> xmlReader.setEntityResolver(catalogResolver);
>>>
>>> xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes",
>>> true);
>>>
>>> + SourceResolver uriResolver = new SourceResolver(this);
>>> + // create xslt transformer:
>>> SAXTransformerFactory tf =
>>> (SAXTransformerFactory)TransformerFactory.newInstance();
>>> + tf.setURIResolver(uriResolver);
>>>
>>> String[] xsltPaths = viewDescriptor.getXSLTPaths();
>>> if (xsltPaths == null || xsltPaths.length == 0) {
>>> xsltPaths = getXSLTPath(getPath());
>>> }
>>> - SourceResolver uriResolver = new SourceResolver(this);
>>> TransformerHandler[] xsltHandlers = new
>>> TransformerHandler[xsltPaths.length];
>>> for (int i = 0; i < xsltPaths.length; i++) {
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Yanel-development mailing list
>>> Yanel-development at wyona.com
>>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>
>>
>>
>
>
--
+41 79 616 53 76
www.linkedin.com/in/taroza
Optaros - www.optaros.com
More information about the Yanel-development
mailing list