Newbie in XQUERY small question

I

inarobis

Hey all,

I am newbie in XQUERY I would like to query my xml file.
I have this piece of xml file


<TEST>
<TableID>
<ID>1</ID>
<roomName>Suite</roomName>
<TableRoom>
<ID>1</ID>
<A> 100
<Date>31.07.2005</Date>
</A>
</TableRoom>
<TableRoom>
<ID>1</ID>
<A>411
<Date>31.08.2005</Date>
</A><TableRoom>
<TableRoom>
<ID>1</ID>
<B>462
<Date>31.07.2005</Date>
</B>
</TableRoom>

I would like to have something of this kind (put in commun the date )

<TEST>
<TableID>
<ID>1</ID>
<roomName>Suite</roomName>
<TableRoom>
<ID>1</ID>
<Date>31.07.2005</Date>
<A> 100</A>
<B>462</B>
</TableRoom>
<TableRoom>
<ID>1</ID>
<Date>31.08.2005</Date>
<A>411</A>
<T/ableRoom> There is no info for B

this is my xquery code

<TEST>
{
for $i in doc("transformXQUERY.xml")//TableID/TableRoom,
$TableRoom in $i,
$a in $TableRoom/A
:)$b in $TableRoom/B
where $a/Date = $b/Date:) I have a problem here
order by $TableRoom/ID
return

<TableID>
{$i/ID}
{$a}
{$i/B}
</TableID>
}
</TEST>


any suggestions/ help

ina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top