473,399 Members | 3,888 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,399 software developers and data experts.

Xquery, repeating elements, Sleepycat's DB XML

Bob
Hello,

I hope this is the right newsgroup to ask the following question about XML.

I would like to have something like the following:

<testcase>
<name>foo</name>
<type>typeA</type>
<command>foo.sh</command>
<command>foo2.sh</command>
</testcase>
<testcase>
<name>bar</name>
<type>typeB</type>
<command>bar.sh</command>
</testcase>
<testcase>
<name>zum</name>
<type>typeA</type>
<command>zum.sh</command>
</testcase>

The key point for this example is that "<command> appears more than once
in the first "<testcase>" element. I would like to be able to query the
above (using Sleepycat's DB XML) something like this:

query 'for $t in collection("")/testcase[type='typeA']/command/text()'

expecting output something like this

foo.sh
foo2.sh
zum.sh

But, I get an error about "<command>" appearing more than once. I know the
above structure is a no-no in the relational (SQL) world but I thought
I saw somethig similar to the above in other XML applications. The example
I am thinking of is a phone directory where there can be multiple phone
numbers, each with an attribute like 'type="cell"'. I tried adding dummy
attributes to my example above but it didn't help.

Is there some way to do this correctly?

Thanks,
Bob
Nov 23 '05 #1
0 1184

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

Similar topics

1
by: Wolfgang Lipp | last post by:
my question is: do we need container elements for repeating elements in data-centric xml documents? or is it for some reason very advisable to introduce containers in xml documents even where not...
7
by: Jeff Kish | last post by:
Greetings. I can't invest a large amount of time into this, but it would be very helpful if I could do this. I have a directory full of xml files I'd like to be able to query to find out...
11
by: Jeff Kish | last post by:
Just wondering if it was possible to xquery an xml file to retrieve all elements that had a given text value or all elements where any attribute had a value of interest. I guess I could figure...
1
by: FBS | last post by:
Hi everybody, I wonder if somebody could help me with this issue. I would like to rum some XQuery codes aginst my XML files and since I'm quite new in this area I'm not sure what to do. It is...
0
by: Stylus Studio | last post by:
DataDirect XQuery(TM) is the First Embeddable Component for XQuery That is Modeled after the XQuery API for Java(TM) (XQJ) BEDFORD, Mass.--Sept. 20, 2005--DataDirect Technologies...
2
by: nickheppleston | last post by:
I'm trying to iterate through repeating elements to extract data using libxml2 but I'm having zero luck - any help would be appreciated. My XML source is similar to the following - I'm trying to...
7
by: paul.rusu | last post by:
I have a element "v" wich has different types of objects a,b,c. and i do: for $x in $doc/v/a where ... return $x for $x in $doc/v/b where ... return $x for $x in $doc/v/c where ... return $x...
3
by: Bloody Viking | last post by:
Namaste, Y'all! I've got a valid XQuery expression that I need to convert to XPath 2.0. This expression will be stored in a resource file and applied to XML by a Java program with saxon8.jar...
0
by: jeoffh | last post by:
Background: I am trying to "merge" some attributes into an existing XML column in my MS SQL 2005 database. The general idea is that I have an XML column in a table and I would like to update/delete...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.