[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: No of Times Named Template called
Hi Martin, Thanks for the input. I am getting zero for all the inputs. My XML Data looks like this <req bid="38180" ><mydata>Senthil</mydata></req> <exp_resp><code>OK</code><message>Test1</message><fault></fault></exp_resp> <resp><code>OK</code><message> Test1 </message><fault>test</fault></resp> </result> Could you please ,what am I doing wrong in here? <xsl:variable name="result"> <xsl:for-each select="report/result"> <xsl:if test="normalize-space(resp/fault)=normalize-space(exp_resp/fault)"> <xsl:call-template name="STATUS_DETECTION"> <xsl:with-param name="my-param" select="S" /> </xsl:call-template> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="no-of-S" xmlns:exslt="http://exslt.org/common" select="count(exslt:node-set($result)/img[contains(@src, 'success')])" /> <xsl:value-of select="$no-of-S" /> <xsl:template name="STATUS_DETECTION"> <xsl:param name="my-param" /> <xsl:choose> <xsl:when test="$my-param='S'"> <img src="../img/success.png"/> </xsl:when> <xsl:otherwise> <img src="../img/failure.png"/> </xsl:otherwise> </xsl:choose> </xsl:template> On Thu, Mar 13, 2008 at 10:57 AM, Martin Honnen <Martin.Honnen@xxxxxx> wrote: > Senthilkumaravelan K wrote: > > > I use java XALAN processor. > > I think Xalan supports the EXSLT extension function node-set so you can try > > > > <xsl:variable name="result"> > <xsl:for-each select="report/result"> > <xsl:if test="normalize-space(resp/fault)=normalize-space(exp_resp/fault)"> > <xsl:call-template name="STATUS_DETECTION"> > <xsl:with-param name="my-param" select="S" /> > </xsl:call-template> > </xsl:if> > </xsl:for-each> > </xsl:variable> > <xsl:variable name="no-of-S" > xmlns:exslt="http://exslt.org/common" > select="count(exslt:node-set($result)/img[contains(@src, 'success')])" /> > > > No of S<xsl:value-of select="$no-of-S" /> > > -- > > > > Martin Honnen > http://JavaScript.FAQTs.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|