Problem when using xsl:key

wxdqz

New Member
Hi.I am having a problem when I use xsl:key. The architecture I am using isas follows.I have written java code using Apache Xalan APIs to parse XML/XSL and generateoutput page.The XML has the data needed for an SQL Query. The java code generates theActual SQL queryusing this data and then executes that Query to get rows of data from thedatabase. Then itgenerates an intermediate XML with this data and then applies the given XSL.When I use xsl:keyin my XSL, it doesnt work. It give me java.lang.NoSuchMethodError.The amazing thing is that, when I take that intermediate XML and apply thatsame XSL using theXalan's Command line Process, it works fine.Could somebody throw some light on this and tell me why this happens andalso a solution/workaround for this please..Following is the XML/XSl.-------XML---------<?xml version="1.0" standalone="yes"?><ReportDefinition Name="Bookings" Title="Bookings"><Parameter Name="GlobalDealId"/><TableDefinition Name="Rebates" Title="Rebates"><Column SQLName="sh.global_deal_id" Datatype="string"/><RowSet Name="Instances" RowType="Data" SQLFrom="qtc_so_headers_infosh"SQLWhere="sh.global_deal_id = '$GlobalDealId$'"></RowSet></TableDefinition></ReportDefinition>----XSL-------<?xml version="1.0" standalone="yes"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"xmlns:lxslt="http://xml.apache.org/xslt"><xsl:key name="getIt" match="TableCell[1]" use="TableCell[1]"/><xsl:template match="Report">xxxxxx Reporting<xsl:text/><xsl:apply-templates select="TABLE"/></xsl:template><xsl:template match="TABLE">About to execute getIt<xsl:text/><xsl:for-each select="key('getIt',3168)/">loop getIt<xsl:text/><xsl:value-of select="."/><xsl:text/></xsl:for-each></xsl:template></xsl:stylesheet>--- The intermediate XML looks like this...<?xml version="1.0" encoding="UTF-8"?><Report Name="Second" Title="Title"><Parameter Name="GlobalDealId" Value=http://forums.devx.com/archive/index.php/"3168"></Parameter><TABLE Columns="1" Name="Rebates" Title="Rebates"><Row RowType="Heading" Title="Rebates"><ColumnHeading Name=""></ColumnHeading></Row><Row Name="Instances" RowType="Data"><TableCell Datatype="string" Name="" Pattern="" SecurityType="">3168</TableCell></Row><Row Name="Instances" RowType="Data"><TableCell Datatype="string" Name="" Pattern="" SecurityType="">3168</TableCell></Row><Row Name="Instances" RowType="Data"><TableCell Datatype="string" Name="" Pattern="" SecurityType="">3168</TableCell></Row></TABLE></Report>RgdsPrasad..
 
Back
Top