Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.11.0, 2.11.1
-
None
-
Unknown
Description
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>