This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Detecting presence of attributes
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Detecting presence of attributes
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Sun, 4 Feb 2001 23:13:11 GMT
- References: <jUsT.aNoTheR.mEsSaGe.iD.98132567412860@silmaril.ie>
- Reply-To: xsl-list at lists dot mulberrytech dot com
(a) the attribute foo was specified but the value was the null string
"", or
(b) the attribute foo was not specified at all.
yes.
If you just want to test (b) use test="@foo"
> xt does not appear to honor either.
does so.
> Is this a bug in xt, or have
unlikely
> I missed some additional piece of syntax.
hard to say. Are you sure the attribute isn't being defaulted by the
dtd.
> A second problem arises with the position() function. In xt this appears
> only to work within an <xsl:for-each> loop, not in a node group
"node group" isn't a defined concept, (see the long thread on node sets
over the last week:-)
> instantiated by a match or select.
matchs don't select node set's so I don't know what you mean by that,
but position() works whenever there is a current node list, so
xxx[position()=3]
or
<xsl:template match="xxx">
<xsl:if test="position()=3">
or various other constructs.
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list