This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Syntax Assistance Needed
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Scott Purcell" <spurcell at vertisinc dot com>
- Cc: XSL-list at lists dot mulberrytech dot com
- Date: Fri, 17 May 2002 15:07:11 +0100
- Subject: Re: [xsl] Syntax Assistance Needed
- Organization: Jeni Tennison Consulting Ltd
- References: <34385CBC5E8E664EB0007814636AB36A1F656A@exchange1.dimensions.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Scott,
> I have the following code
> <xsl:if test="label[.!='']">
>
> I am picking up a project from someone else, and I cannot find the
> meaning of [.!='']
>
> I have searched quite hard to find out what the . means but never
> found it. Could someone please explain what that means and what the
> '.' period means. As it is used in quite a few other lines.
>
> eg <xsl:when test="item_type[.='user_art']">
The . means "the context node".
. != ''
means "the value of the context node is not an empty string", or "the
context node has some textual content".
So label[. != ''] selects the label element child of the context node
that has some text inside it (at any level). You can do the same with
label[string()] if you want. Since this is in a test, it might be
easier to just do:
label != ''
The path item_type[. = 'user_art'] selects the item_type element whose
string value is 'user_art'. Again, since it's in a test, it's easier
to do:
item_type = 'user_art'
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list