Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSLT: How to find a node containing TWO matching children?

Reply
Thread Tools

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

 
 
bearclaws
Guest
Posts: n/a
 
      03-10-2005
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

 
Reply With Quote
 
 
 
 
Joris Gillis
Guest
Posts: n/a
 
      03-10-2005
Tempore 18:40:18, die Thursday 10 March 2005 AD, hinc in foro {comp.text.xml} scripsit bearclaws <>:

> ...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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-10-2005


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/
 
Reply With Quote
 
bearclaws
Guest
Posts: n/a
 
      03-10-2005
thanks! I was making my statement *much* more complicated than it
needed to be!

>>BC


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
select XML node containing a matching string pal.saurabh@gmail.com XML 1 05-16-2007 03:42 PM
How to find node in TreeView by using string(the same as Node.Text) ? jiing ASP .Net 0 04-27-2007 02:34 AM
XSL problem matching node containing xmlns attribute clover2411 XML 4 01-23-2007 12:38 PM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM



Advertisments