Philippe Nobili wrote: > > We have another question, related to how transformation parameters are > passed to XSLT stylesheets from XXE parameter sets. > > Our problem is the following: > > + We have our XSLT transformation running fine from XMLMind (XML to XML) > without changing the default parameters setting > > + In our stylesheets, we however have a couple of transformation > parameters that we can change to fine tune the conversion, for > instance (excerpt from our param.xsl file): > > <xsl:param name="coding.for.all.groups" select="0"/> > > The parameter is tested during the transformation, eg.g > <xsl:when test="$coding.for.all.groups = 1">...... > > + From command line, that's no problem, we can use any XSLT 2.0 engine > (e.g. Saxon-9) and specify coding.for.all.groups=1 to change the default > transformation.
Apparently Saxon-9 automatically coerces the passed string value to the actual type of the parameter. XXE which uses the standard Java API (TRaX) to integrate Saxon-9 simply cannot do that. For XXE, all XSLT (1 or 2) stylesheet parameters are considered to be strings. > > If we want to edit this parameter from XXE ( see capture > setting_coding.jpg), we get an error when processing our XML document: > > " > Command execution has failed: > net.sf.trans.XPathexception: Cannot compare xs:string to xs:integer > " > > We understand what it means, but do not how to specify the parameter's > value in XXE...then Please modify your XSLT 2 style sheet to exclusively use *string* parameters. <xsl:param name="coding.for.all.groups" select="'0'"/> OR <xsl:param name="coding.for.all.groups">0</xsl:param> Then, for each string parameter, please use *another* integer variable or parameter created out of this string parameter. (May be there are smarter ways to do that. I'm not an XSLT 2 expert.) -- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support

