Re: [xsl] Using two strings with start-with() or contains() functions

Subject: Re: [xsl] Using two strings with start-with() or contains() functions
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 26 Mar 2009 18:19:53 -0400
Charles,

At 04:53 PM 3/26/2009, you wrote:
I'm trying to do something like this:


<xsl:if test="contains(./TITLE, 'REMOVAL' | 'Removal')"> <remove> <title>REMOVAL</title> -------- other stuff and templates----

</remove>
</xsl:if>

Are you wanting to generate this result if your TITLE child contains either 'REMOVAL' or 'Removal'?


If so, try

<xsl:if test="contains(TITLE, 'REMOVAL') or contains(TITLE, 'Removal')">

If you are using XSLT 2.0 you have several more elegant options.

(Note that in XPath, "./TITLE" amounts to the same thing as "TITLE".)

Cheers,
Wendell


====================================================================== 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