[Yanel-dev] URI resoving patch for BasicXMLResource

Michael Wechner michael.wechner at wyona.com
Fri Mar 7 14:36:08 CET 2008


Evaldas Taroza wrote:

> 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().


very much agreed

Michi

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


-- 
Michael Wechner
Wyona      -   Open Source Content Management - Yanel, Yulup
http://www.wyona.com
michael.wechner at wyona.com, michi at apache.org
+41 44 272 91 61



More information about the Yanel-development mailing list