Subject: RE: Re: Looping through attributes..
From: cknell@xxxxxxxxxx
Date: Thu, 20 Mar 2003 17:03:12 -0500
|
I think you guys have misunderstood Karl's question. If I read it correctly, Karl wants only those elements whose *name* begins with a certain string, like this:
<xsl:if test="starts-with(name(), 'c')">
--
Charles Knell
cknell@xxxxxxxxxx - email
-----Original Message-----
From: David N Bertoni/Cambridge/IBM <david_n_bertoni@xxxxxxxxxx>
Sent: Thu, 20 Mar 2003 13:30:35 -0800
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Looping through attributes..
> Okay, I'm looping through attributes. Now I need to determine if the
name
> of an attribute starts with a particular text expression. I have the
> following (and it doesn't work):
>
> <xsl:for-each select="@*">
> <xsl:if test="starts-with(@,'S')">
> ...
> </xsl:if>
> </xsl:for-each>
>
> Am I close???
Yes:
<xsl:for-each select="@*">
<xsl:if test="starts-with(.,'S')">
...
</xsl:if>
</xsl:for-each>
or even:
<xsl:for-each select="@*[starts-with(.,'S')]">
...
</xsl:for-each>
if you're just going to ignore the attributes which don't start with 'S'.
Hope that helps.
Dave
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|
cknell - Thu, 20 Mar 2003 17:00:05 -0500 (EST) <=
Passin, Tom - Thu, 20 Mar 2003 17:09:49 -0500 (EST)
Joe Meree - Fri, 21 Mar 2003 08:18:40 -0500 (EST)
|
|