Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - Newbie in XQUERY small question

 
Thread Tools Search this Thread
Old 07-20-2006, 03:38 PM   #1
Default Newbie in XQUERY small question


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



inarobis@gmail.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump