xsl-list
[Top] [All Lists]

Re: [xsl] Matching for strings...

2006-09-06 08:50:17
On 9/6/06, Bob Portnell <simply(_dot_)bobp(_at_)gmail(_dot_)com> wrote:
Well, the Cookbook didn't help with this problem, or at least not that I saw.

So, my data (in part) is like this..

<xtvd>
    ...
    <programs>
        <program id(_at_)="...">
            <title> ... </title>
            <subtitle> ... </title>
            <description ... </title>
            ...
        </program>
        <program>
        ...
        </program>
        ...
    </programs>
    ...
</xtvd>

(Yes, it's the ever-popular DataDirect TV listings from Tribune Media
Services... I'm working with the data in its "native" xtvd structure,
rather than doing the very long-winded transform to the more popular
XMLTV structure.)

I want to find <program> elements whose <title> or <subtitle> or
<description> might contain the string I've stowed in the variable
$target. Something simple like

...so something like:

select="//program[contains(title, $target) or contains(subtitle,
$target) or contains(description, $target)]"

cheers
andrew

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