xsl-list
[Top] [All Lists]

Re: Selecting a node based on two sub-element values

2005-02-15 01:44:54
I worked it out :

DATA/ITEM[SUBDATA1/VALUE/text()='AA' and SUBDATA2/SCORE/VALUE='1']

I had an upper case 'AND' rather than lower case 'and'.

----- Original Message ----- 
From: "Steve W" <lsl(_at_)btconnect(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Tuesday, February 15, 2005 8:11 AM
Subject: [xsl] Selecting a node based on two sub-element values


Hi,

I have XML that looks like this :

<DATA>
    <ITEM>
        <SUBDATA1>
            <VALUE>AA</VALUE>
        </SUBDATA1>
        <SUBDATA2>
            <SCORE>1</SCORE>
        </SUBDATA2>
    </ITEM>
        <ITEM>
        <SUBDATA1>
            <VALUE>BB</VALUE>
        </SUBDATA1>
        <SUBDATA2>
            <SCORE>1</SCORE>
        </SUBDATA2>
    </ITEM>
        <ITEM>
        <SUBDATA1>
            <VALUE>AA</VALUE>
        </SUBDATA1>
        <SUBDATA2>
            <SCORE>3</SCORE>
        </SUBDATA2>
    </ITEM>
</DATA>

How do I select all the <ITEM> elements where <VALUE> elements contain
'AA'
and <SCORE> elements contain '1' ?

Thanks

Steve


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




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