[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: Xsl:variable problem ??

Subject: AW: Xsl:variable problem ??
From: Markus Abt <abt@xxxxxxxx>
Date: Thu, 21 Aug 2003 23:26:12 +0200
xsl var
Hi Dipesh,

you can't (re)assign values to the "global" variables colHeaderForTable1
and maxColNoForTable1.
Therefore, you cannot use <xsl:for-each> to calculate the maximum.
You must use recursion instead.

If you post your XML (and it's not too long to read), then maybe
someone will post a solution.


Regards,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de


----------
Von: 	Dipesh Khakhkhar
Gesendet: 	Donnerstag, 21. August 2003 22:53
An: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: 	 Xsl:variable problem ??

Hi,

I want to get value of attributes for a particular node having maximum 
attributes.

Fort this i need to use global variable to store the final value and one 
global variable to store the maximum no. of attributes in a given node to 
compare with the other nodes.

Syntax might not be proper in the following snippet

<!-- Defining Global variables -->
xsl:var name=colHeaderForTable1;
xsl:var name=maxColNoForTable1 select="number(0)"; <!-- Keeping maximum number 
of attributes for the particular node as zero -->
xsl:for-each //Table1
xsl:var name=temp select ="count(no. of columns in this table)"; <! --getting 
column count for the current table -->

<!-- For the firt time this comparision will be true and in the global 
variable i will get names of the attribute name -->
if (temp > maxColNoForTable1)
colHeaderForTable1={"Somevalue", "Somevalue",Getting each attribute name 
followed by seperator}

</xsl:for-each>

<!-- In this way I want the names of the attributes for a node having maximum 
no. of attributes. The problem here is i can not change the variable value, so 
is there any other way to achieve the same. I have not defined the variable 
inside for loop since I would need that value in future processing of my 
document.

So can i approach this problem ??

Eagerly waiting for reply.

Regards,
Dipesh


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.