camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-6661) xslt: TransformerException: include href is empty
Date Tue, 31 Dec 2013 07:54:51 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-6661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13859400#comment-13859400
] 

Willem Jiang edited comment on CAMEL-6661 at 12/31/13 7:54 AM:
---------------------------------------------------------------

Applied the patch into master, camel-2.12.x and camel-2.11.x branches with thanks to Rene.


was (Author: njiang):
Applied the patch with thanks to Rene.

> xslt: TransformerException: include href is empty 
> --------------------------------------------------
>
>                 Key: CAMEL-6661
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6661
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-xslt
>    Affects Versions: 2.11.0, 2.11.1
>            Reporter: Per Cederin
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.11.3, 2.12.3, 2.13.0
>
>         Attachments: XslIncludetEmptyHrefTest.java, XsltUriResolver.patch, transform_includes_data.xsl
>
>
> The use of the xlst function, document(''), gives an exception like:  
> "javax.xml.transform.TransformerException: include href is empty"
> when transforming, using the component camel-xslt.
> It seems that camels XsltUriResolver only is capable to handle files 
> either from the classpath or the file system. 
> With the xlst function, document(''), the xslt processor should be able to handle that
the result 
> "is the source XML of the XSLT document itself".
> Below is an example.
> A XML document:
> <?xml version="1.0" encoding="ISO-8859-1"?> 
> <root>1</root>
> A XSL document:
> <?xml version="1.0" encoding="UTF-8"?> 
> <xsl:stylesheet  xmlns:date="http://exslt.org/dates-and-times" version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>         <date:months>
>                 <date:month length="31" abbr="Jan">January</date:month>
>                 <date:month length="28" abbr="Feb">February</date:month>
>         </date:months>
>         <xsl:template match="root">
>                         <xsl:variable name="month-node" select="document('')/*/date:months/date:month[number(2)]"/>
>                         <xsl:element name="MyDate">
>                                 <xsl:value-of select="$month-node"/>
>                         </xsl:element>
>         </xsl:template>
> </xsl:stylesheet> 
>  
> After transformation the following should be produced:
> <?xml version="1.0" encoding="UTF-8"?><MyDate>February</MyDate>



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message