By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,640 Members | 2,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,640 IT Pros & Developers. It's quick & easy.

XSLT: How to find a node containing TWO matching children?

P: n/a
I have the following XML:

<AAA>
<BBB>
<CCC>111</CCC>
<CCC>222</CCC>
</BBB>
<BBB>
<CCC>333</CCC>
<CCC>444</CCC>
</BBB>
</AAA>

....and want to loop through AAA to find all BBBs that contain CCC nodes
matching 333 AND 444.

Any thoughts on the most effecient syntax for this?

Thanks,
BC

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Tempore 18:40:18, die Thursday 10 March 2005 AD, hinc in foro {comp.text.xml} scripsit bearclaws <go**********@bencannon.com>:
...and want to loop through AAA to find all BBBs that contain CCC nodes
matching 333 AND 444.

what about "AAA/BBB[CCC='333' and CCC='444']" ?
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
"Quot capita, tot sententiae" - Terentius , Phormio 454
Jul 20 '05 #2

P: n/a


bearclaws wrote:
I have the following XML:

<AAA>
<BBB>
<CCC>111</CCC>
<CCC>222</CCC>
</BBB>
<BBB>
<CCC>333</CCC>
<CCC>444</CCC>
</BBB>
</AAA>

...and want to loop through AAA to find all BBBs that contain CCC nodes
matching 333 AND 444.


If <AAA> is the root element there is not much to loop through, as for
an XPath you would need
/AAA/BBB[CCC = '333' and CCC = '444']

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #3

P: n/a
thanks! I was making my statement *much* more complicated than it
needed to be!
BC


Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.