473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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
3 1246
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


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
thanks! I was making my statement *much* more complicated than it
needed to be!
BC


Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joachim Spoerhase | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I am a XSLT-beginner and i read the XSLT-recommendation of the W3C through. But I did'nt really understand section 5.5 of the latest...
9
by: Iain | last post by:
I want to create an XML configuration file which might look like <REGION Name="Europe" WingDing="Blue"> <COUNTRY Name="UK" WingDing="white"> <TOWN Name="London" WingDing="Orange" /> </COUNTRY>...
1
by: Martin Bright | last post by:
I am trying to write an XSLT template which creates a subtree of an input document, which is a simple tree. For example, the input might be <node name="1"/> <node name="2"> <node name="2.1"/>...
1
by: arnold | last post by:
Hi, I've been knocking my head against the wall trying to create an XSL transform to perform "normalizations" of a set of XML files that have a common structure. % XML file before transform
6
by: Neal | last post by:
Hi All, I used an article on XSLT and XML and creating a TOC written on the MSDN CodeCorner. ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dncodecorn/html/corner042699.htm However, it did'nt...
18
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to...
3
by: abhishek.smu | last post by:
Given an XML like: <root> <node>8</node> <node>21</node> <node>-7</node> <node>13</node> <node>43</node> <node>2</node> </root>
2
by: Ryan Nordman | last post by:
Hey XML gurus, Is there a way to write a template so that it will compare two XML subtrees wholesale? I can't quite get my head around this problem. Let's say I have these two XML trees, both...
3
by: z1 | last post by:
hi- i am fooling around with soap and weather templates. for some reason either this if or select is failing. i am very new to xml and found this code at another site. i can show you the xml...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.