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

RE: Searching within a text

Subject: RE: Searching within a text
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 5 Jul 1999 16:50:09 +0100
RE: Searching within a text
It would be easier if your XML document used XML tagging for all its
structure, rather than using a comma-delimited syntax internally.

But if you must use this syntax, you can select the relevant elements using,
say:

<xsl:variable name="v" expr="normalize(animal/text())"/>
<xsl:if test="starts-with($v,'cat,') or contains($v,',cat,') or
ends-with($v,',cat')">

This assumes there are no embedded spaces.

Mike Kay

> 
> In my XML-file I have an enumeration of keywords in the animal-tag:
> <person>
>    <animal>
>        cat,dog,bird,...
>    </animal>
> </person>
> <person>
>    <animal>
>        monkey,cat,mouse,...
>    </animal>
> </person>
> 
> Now I want to select those persons that have a certain 
> keyword, for example 
> cat,with an xsl-statement.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.