I'm trying to use an array in XLST in my ServiceMix module.
here is my Array definition
<attr:Data>
<Item1/>
<Item2/>
.
.
.
</attr:Data>
this is how I invoke my array
<xsl:for-each select="document('')/*/attr:Data/*">
...
</xsl:for-each>
It works great in Eclipse, but when I deploy it in ServiceMix I get a include href is empty TransformerException. I tried the net.sf.saxon.trans.XPathException and the org.apache.xalan.processor.TransformerFactoryImpl processor and I'm getting the same error. The ServiceMix version I use is 4.4.1-fuse-01-13.
I don't know ServiceMix but it looks as if it isn't setting the base URI of the stylesheet, which means that document('') won't work. If you can't change the way ServiceMix invokes the transformation then your best option is probably to put the data in a global variable:
<xsl:variable name="data">
<attr:Data>
<Item1/>
<Item2/>
.
.
.
</attr:Data>
</xsl:variable>
and access it as select="$data/attr:Data/*"
if using Saxon (XSLT 2.0) or as select="xx:node-set($data)/attr:Data/*"
if using Xalan (XSLT 1.0)