|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Count a substring of an attribute in childnodes
Hi all,
I am trying to transform CALS tables to HTML in one pass. To this, I need the total number of all colwidth attributes that contains a *. The following XML snippet should give me a total of 600. <?xml version="1.0"?> <tgroup cols="3" colsep="0" rowsep="0" align="left"> <colspec colname="1" colwidth="100*" /> <colspec colname="2" colwidth="200*" /> <colspec colname="3" colwidth="300*" /> </tgroup> I have tried with <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:apply-templates select="tgroup"/> </xsl:template> <xsl:template match="tgroup"> <xsl:variable name="total-colwidth" select="'count(number(colspec[contains(@colwidth,'*')]/substring-before(@colwidth,'*')))'"/> <Output><xsl:value-of select="$total-colwidth"/></Output> </xsl:template> </xsl:stylesheet> But this one gives me <Output>NaN</Output> What am I doing wrong? Regards, Ragulf Pickaxe :-| _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
|
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
|

Cart








