This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: matching nodes by their value


On Thu, Aug 17, 2000 at 10:29:19AM +0200, Robert Stupak wrote:

> But this leads to a following question:
> value of a node is "concatenation of all parsed character data between
> element's start tag and end tag"

Or (a little more precisely) from the XPath spec:
 "The string-value of an element node is the concatenation of the string-values
 of all text node descendants of the element node in document order."

> So according to this,  the value of such <a> node:
> <a "href=//"><font><font>AAA</font>BBB</font></a>
> should be 'AAABBB' (or 'AAA BBB' ?) and it starts with 'A',

Yes.

> but starts-with(a,'A') doesn't match such node.

What XSLT processor are you using? Perhaps it has a bug.
The following documents produce "true" using XT.

==> a.xml <==
<td><a href="//"><font><font>AAA</font>BBB</font></a></td>

==> a.xsl <==
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="text"/>

    <xsl:template match="/*">
      <xsl:value-of select="starts-with(a,'A')"/>
    </xsl:template>
    
</xsl:stylesheet>



 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]