[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Searching text within a node

Subject: Re: Searching text within a node
From: "Lee" <lee@xxxxxxxxxxxxx>
Date: Thu, 06 Aug 2009 16:45:30 -0500
Re:  Searching text within a node
Shaaweet! Worked like a charm. Thank you.

I was close on my own with
<xsl:if test="'Smith'=Form/Names/LastName or test=not(Form/Names/LastName)">
which did not work.



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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.