You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Robinson Simon <Si...@newton.co.uk> on 2003/03/27 10:35:58 UTC

Xpath does not recognise parameter values when run through Tomcat

I am having a problem when trying to get pass a value into a XSL transformation.

The parameters are recognised and I can display the values which I pass in, but when I want to use the 
values in Xpath such as <xsl:variable name="one" select="//fullname[@one=$attributeid]"/> nothing is produced, but when I do

<xsl:variable name="one" select="//fullname[@one='simon']"/> the exact output I require is produced.

This is only a problem when doing the transformn using Java to call the transformation through Tomcat.

                if (XMLSource.getClass().getName().compareTo("javax.xml.transform.stream.StreamSource") == 0 ) {
                        if(transformResult.getClass().getName().compareTo("javax.xml.transform.stream.StreamResult") == 0 )
                        { System.out.println("JT Got this far then 2.1" + element_name_search);
                                transformer.setParameter("attributeid","simon");
                                transformer.transform((StreamSource) XMLSource,(StreamResult)transformResult); }
		System.out.println("The value of the attributeid parameter is before call is" + element_name_search);

When I do the tranform through the command line I get the expected output.

Can anyone help me. I believe it maybe incompatibilities between versions of Tomcat/JSP/Xalan.

Has anyone else seen this problem.

Regards

Simon