Subject: Re: [xsl] Value of attribute starts-with or contains From: Michael Müller-Hillebrand <mmh@xxxxxxxxxxxxx> Date: Thu, 5 Jun 2008 21:30:55 +0200 |
I just learned about the -- very old and long-existing, but I never had to use it -- function starts-with() by browsing Michael Kays wonderful (and heavy) Reference ("The Book").
I guess you want something like
count(.//entry[contains(@aid5:cellstyle, 'tbody_cell')])
- Michael
PS: This just checks for "contains" and not "begins with".
<xsl:value-of select="count(.//entry[starts-with(@aid5:cellstyle, 'tbody_cell')])"/>
<xsl:template match="entry[starts-with(@aid5:cellstyle, 'tbody_cell')]"> </xsl:template>
In your original post you mention looking for ;contains or starts- with+. Since starts-with is a subset of contains, there is no use of checking both. You either want contains() or you want starts-with().
<table> <thead> <entry aid5:cellstyle=tbody_cell"> <para>xxx</para> </entry> <entry aid5:cellstyle=tbody_cell"> <para>xxx</para> </entry><entry aid5:cellstyle=tbody_cell_l"> <para>xxx</para> </entry><entry aid5:cellstyle=tbody_cell_l"> <para>xxx</para> </entry> </thead> </table>
All I am trying to do is while in <table> trying to count the nos entry whose @aid5:cellstyle contains or starts-with tbody_cell.
Believe me I've used these functions lots of time mostly with nodes, but nothings seems to be working with attributes. May be I never tested "attribute values" with these functions.
Any clue will be highly appreciated.
-- _______________________________________________________________ Michael M|ller-Hillebrand: Dokumentation Technology Adobe Certified Expert, FrameMaker Consulting and Training, FrameScript, XML/XSL, Unicode Blog [de]: http://cap-studio.de/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Value of attribute starts, Michael Müller-Hille | Thread | RE: [xsl] Value of attribute starts, Pankaj Chaturvedi |
Re: [xsl] XQuery basics, Liam Quin | Date | Re: [xsl] searching for occurrences, Michael Müller-Hille |
Month |