Subject: Re: [xsl] Searching text within a node From: "Lee" <lee@xxxxxxxxxxxxx> Date: Thu, 06 Aug 2009 16:45:30 -0500 |
On Thu, 06 Aug 2009 17:12:35 -0400 Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote:
Lee,
You can test whether a node set is empty by using the not() operator, as in
test="not(Form/Names/LastName)"
which would be true if no LastName elements existed. You could connect that with an 'or':
<xsl:if test="'Smith'=Form/Names/LastName or not(Form/Names/LastName)">
This passes if 'Smith' is found as a value on a node in the set (Form/Names/LastName), or if that set is empty (no such nodes exist).
That may not be exactly what you want, however. You need to specify exactly what you mean by the "non-existence of the node <LastName>".
Cheers, Wendell
At 04:13 PM 8/6/2009, you wrote:I have one more problem. I also need to test for the non-existence of the node <LastName> using an "or" on the "if" statement.
So something like <xsl:if test="'Smith'=Form/Names/LastName or ">
Thanks.
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Searching text within a n, Wendell Piez | Thread | [xsl] Splitting file into N-sized c, Martynas Jusevicius |
Re: [xsl] Where are the proceedings, Liam Quin | Date | Re: [xsl] Where are the proceedings, Wendell Piez |
Month |