Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2010, 10:09 AM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default access xsl variable values from 1 template to another

Hi

I have a small problem in xslt

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="List">
<xsl:apply-templates select="A1|A2|A3|A4|A5"/>
<div class="grid">
<table cellSpacing="0px" cellPadding="2px" width="100%">
<xsl:choose>
<xsl:when test="count(A1Child|A3Child|A5Child) &gt; 0">
i am displaying the table structure
and also i am getting a value like
<xsl:variable name="FPCount" select="count(child::*[name() = 'A2'])"/>
<xsl:when>
</xsl:choose>
</div>
</xsl:apply-templates>
<xsl:template match="A1Child|A3Child|A5Child">

display results

NOTE: now can i access the FPCount value so that depending on FPCount
i want to display a td or else different td

</<xsl:template>

</xsl:template>
</xsl:stylesheet>
 
Old October 29th, 2010, 10:50 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Consider to post a sample of the XML input you have and the corresponding HTML output you want to create with XSLT, then we can suggest a way with XSLT to achieve that.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to refer variable values in xsl stylesheet csdevi XML 3 August 16th, 2010 02:19 PM
Store Javascript return values in XSL variable jramesh79 XSLT 4 July 29th, 2009 06:12 AM
how to assign one variable value to another xsl variable in xsl Anil_Base XSLT 3 March 24th, 2009 01:17 PM
xsl:call-template name="$variable" problem chemi XSLT 1 October 6th, 2005 07:28 AM
how to return nodeset in template in xsl:variable alexshiell XSLT 3 March 18th, 2005 01:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.