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

RE: xpath problem

Subject: RE: xpath problem
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 7 Aug 2001 10:02:03 +0100
xml mcid
> 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


Current Thread
  • xpath problem
    • Earl Spencer - Mon, 6 Aug 2001 15:20:54 -0400 (EDT)
      • Michael Kay - Tue, 7 Aug 2001 05:01:36 -0400 (EDT) <=
      • <Possible follow-ups>
      • Oliver Becker - Tue, 7 Aug 2001 04:53:13 -0400 (EDT)

PURCHASE STYLUS STUDIO ONLINE TODAY!

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