This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: name() and attribute()
- To: xsl-list at mulberrytech dot com
- Subject: Re: name() and attribute()
- From: Lee Goddard <home at leegoddard dot com>
- Date: Wed, 23 Aug 2000 16:05:05 +0100
- Organization: Little Bits Ltd / Research Centre for Cognitive Science, University of Sussex
- References: <Pine.LNX.4.21.0008231439030.3168-100000@sun.xlii.org>
- Reply-To: xsl-list at mulberrytech dot com
David Allouche wrote:
>
> On Wed, 23 Aug 2000, Lee Goddard wrote:
> > ...alternatively....
> >
> > I'm trying to output an attribute only if
> > if exists; although the below choose block
> > works, it doesn't really seem like good
> > practice -- could someone please let me
> > know what is?
> >
> > <xsl:choose>
> > <xsl:when test="@name">blue</xsl:when>
> > <xsl:choose>
>
> Could you be more precise, what are the surrounding xsl elements ?
>
> On what data set are you operating, and what do you want to get as output?
>
> Hope this help us help.
Thanks, David.
Using this (suggested by Francis), I wondered if there is a
'case' or 'switch' type statement, rather than using a bunch
of 'if' conditions. But I think I'm asking a bit much!
<xsl:for-each select="@*">
<xsl:text/> attribute name is : <xsl:value-of select="name()"/>
</xsl:for-each>
Cheers,
lee
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list