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