xsl-list
[Top] [All Lists]

Re: [xsl] Matching words in OR

2006-12-11 03:02:00
J.Pietschmann,
probably due to lack of experience.

Thanks a lot for your great support.
It worked fine.

Ciao


---------- Initial Header -----------

From      : "J.Pietschmann" j3322ptm(_at_)yahoo(_dot_)de
To          : xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Cc          : 
Date      : Sun, 10 Dec 2006 21:17:23 +0100
Subject : Re: [xsl] Matching words in OR







cruscio(_at_)libero(_dot_)it wrote:
Hi,
this is part of my XML:

<xml>
     <rowset:data>
        <target:row attr1='1' attr2='900' attr3='ABC' 
attr4='TREE-JOKER-BASEBALL-' />
     </rowset:data>
</xml>

In XSLT 1.0 need to create a regex to match values into attr4, so I need 
something "Perl" like attr4 =~/TREE|JOKER/ 

This is my query:
/xml/rowset:data/target:row[(@attr4 = '/TREE|JOKER/')] but doesn't work.

XSLT 1.0 doesn't use regular expressions (why do you think it does?)
You have to decompose your requirement into available XPath functions,
in your case
  /xml/rowset:data/target:row[contains(@attr4,'TREE') or
    contains(@attr4,'JOKER']
should do the trick.

J.Pietschmann

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




------------------------------------------------------
Mutui a tassi scontati da 40 banche. Richiedi online e risparmia...Servizio 
gratuito. www.mutuionline.it
http://click.libero.it/mutuionline11di06



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>