xsl-list
[Top] [All Lists]

Re: [xsl] Value of attribute starts-with or contains

2008-06-05 00:52:35
Am 05.06.2008 um 08:59 schrieb Pankaj Chaturvedi:

Hi,

Can somebody let me know what's wrong with the below code:

<xsl:value-of
select="count(contains[.//entry/@aid5:cellstyle='tbody_cell'])"/>

It says: Count all child nodes with name "contains" which have descendant elements with name "entry" which have an attribute "aid5:cellstyle" with value "tbody_cell".

I guess you want something like

count(.//entry[contains(@aid5:cellstyle, 'tbody_cell')])

- Michael

PS: This just checks for "contains" and not "begins with".

I've markup:

<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.



Best,

Pankaj Chaturvedi

--
_______________________________________________________________
Michael Müller-Hillebrand: Dokumentation Technology
Adobe Certified Expert, FrameMaker
Consulting and Training, FrameScript, XML/XSL, Unicode
Blog [de]: http://cap-studio.de/




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--