Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

$like$ operator in XSL

Is there a $like$ operator in XSL, which can do a 'like' search, like SQL's
LIKE keyword?
[108 byte] By [Yuenan Yang] at [2007-11-9 14:54:48]
# 1 Re: $like$ operator in XSL
"Yuenan Yang" <yuenan@idcglobal.com> wrote:
>
>Is there a $like$ operator in XSL, which can do a 'like' search, like SQL's
>LIKE keyword?

I would use JScript's String.match(rgExp) to do that.
<xsl:if test=...> can be used to do that

Rohit
Rohit Wason at 2007-11-11 23:34:02 >
# 2 Re: $like$ operator in XSL
Yuenan,

The XPath contains() function

Greg

Yuenan Yang <yuenan@idcglobal.com> wrote in message
news:38fd0e76$1@news.dev-archive.com...
>
> Is there a $like$ operator in XSL, which can do a 'like' search, like
SQL's
> LIKE keyword?
Greg Longtin at 2007-11-11 23:34:57 >
# 3 Re: $like$ operator in XSL
So no $like$ operator in select pattern at all?
Yuenan Yang at 2007-11-11 23:36:00 >
# 4 Re: $like$ operator in XSL
Yuenan,

I'm sorry I wasn't clearer. The XPath 'contains' function is very similar
to the SQL 'Like' operator.

Greg Longtin

"Yuenan Yang" <yuenan@idcglobal.com> wrote in message
news:38fe5f17$1@news.dev-archive.com...
>
> So no $like$ operator in select pattern at all?
Greg Longtin at 2007-11-11 23:37:05 >
# 5 Re: $like$ operator in XSL
The question is, in XSL (http://www.w3.org/TR/WD-xsl),
We can use
<xsl:for-each select="person[@firstname $iqe$ 'yuenan']" order-by="lastname">,
is there a solution like,

<xsl:for-each select="person[@firstname $like$ 'uen']" order-by="lastname">

?
Yuenan Yang at 2007-11-11 23:37:59 >
# 6 Re: $like$ operator in XSL
Yuenan,

Final answer (sorry, couldn't resist). AFAIK, not in
http://www.w3.org/TR/WD-xsl without script.

http://www.w3.org/1999/XSL/Transform does allow it...

Sorry,

Greg

Yuenan Yang <yuenan@idcglobal.com> wrote in message
news:38ff0d86$1@news.dev-archive.com...
>
> The question is, in XSL (http://www.w3.org/TR/WD-xsl),
> We can use
> <xsl:for-each select="person[@firstname $iqe$ 'yuenan']"
order-by="lastname">,
> is there a solution like,
>
> <xsl:for-each select="person[@firstname $like$ 'uen']"
order-by="lastname">
Greg Longtin at 2007-11-11 23:39:00 >