|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xpath problem
> for this file i used an expression this way
>
> <xsl:for-each select="a">
> <xsl:variable name="mcid"><xsl:value-of select="@mcID"/></xsl:variable>
> <xsl:value-of select="count(b[contains(new,text())])"/>
>
> this gives me a correct value
If this gives you the right answer, it's by chance.
I don't know what the variable mcid is for. You don't have an attribute
called @mcID in your XML source, so it can't be very useful. If it meant
anything, you should probably have written
<xsl:variable name="mcid" select="@mdID"/>
The expression
count(b[contains(new,text())])
counts the number of child <b> elements that have a child element called
<new> whose string-value contains (as a substring) the value of the first
text node child of the <b> element. Since none of your <b> elements have a
child called <new>, this is the same as writing contains("", text()), which
will be true if and only if the <b> element has no text node children.
P.S. Pardon my asking, but is "Earl Spencer" your real name?
Mike Kay
Software AG
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
|

Cart








