This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: how can check whether an attribute exists or not?
David Carlisle a écrit :
I regret to say my French is even worse than my English (which as any
reader of this list will know, is pretty bad:-)
> > <xsl:when test="@href=''">
>
> That tests if the string value is empty, which is true if there isn't an
> attribute or of it s explictly empty.
>
you mean that if i have:
<ok>my_string</ok> in my XML file
i could test <xsl:when test="@ok=''">
to know if my_string is empty or not ?
No I meant the string value of the attribute, not the string value of
the element (that's what the @ is doing) but without the @:
<xsl:when test="ok=''">
(if executed in a template for the parent element) would test if the
first ok child had an empty string as its string value (which isn't the
same as it being empty, <ok><xxx/></ok> would test true for the above
test It would also be true if there were no ok elements.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list