You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Per Cederin (JIRA)" <ji...@apache.org> on 2013/08/22 16:33:52 UTC

[jira] [Created] (CAMEL-6661) xslt: TransformerException: include href is empty

Per Cederin created CAMEL-6661:
----------------------------------

             Summary: xslt: TransformerException: include href is empty 
                 Key: CAMEL-6661
                 URL: https://issues.apache.org/jira/browse/CAMEL-6661
             Project: Camel
          Issue Type: Bug
          Components: camel-xslt
    Affects Versions: 2.11.1, 2.11.0
            Reporter: Per Cederin


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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira