[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] AW: Xsl:variable problem ??
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
|
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
|