Xpath does not recognise parameter values when run through Tomcat 2003-03-27 - By Robinson Simon
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[@(protected)= $attributeid]"/> nothing is produced, but when I do
<xsl:variable name="one" select="//fullname[@(protected)='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
|
|