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

Re: XPath to calculate total of attribute values

Subject: Re: XPath to calculate total of attribute values
From: Lee Goddard <home@xxxxxxxxxxxxxx>
Date: Thu, 10 Jan 2002 13:46:47 +0100
attribute value xpath

Trying to convert a simple HTML2 table: please help!

1. On encountering a TABLE element,
2. examine the first child (guaranteed to be a TR element):
3. count the number of TD elements within the TR (guaranteed the only content),
4. and add to that count the value of every attribute named COLSPAN.

Well, I can count the number of TD's in TABLE/TR,

<xsl:template match="TABLE">
	COUNT 1 [ <xsl:value-of select="count(./TR/TD)"/>  ]

I can't figure out how to write an XPath expression to calculate
a total of all the TD/@COLSPANs....

If the worst comes to the worst, I can add some code to the script that generates
the HTML-like source, so that tables include a COLSPEC-like element, but that
seems an even easier way out than asking for help here....

Worst yet, I've just moved to Hungary and left Mike Kay's book in London
(what was I thinking?)

Thanks in anticipaiton,
lee goddard

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

Current Thread


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.
First Name
Last Name
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.