Newbie in XQUERY small question

Discussion in 'XML' started by inarobis@gmail.com, Jul 20, 2006.

  1. Guest

    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
     
    , Jul 20, 2006
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HNguyen
    Replies:
    0
    Views:
    1,281
    HNguyen
    Jun 3, 2004
  2. HNguyen

    Binding data from XQuery to a dataset

    HNguyen, Jun 3, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    477
    HNguyen
    Jun 3, 2004
  3. amessimon

    problem using xquery and asp.net

    amessimon, Mar 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    725
    amessimon
    Mar 9, 2005
  4. Jeff Kish
    Replies:
    11
    Views:
    1,001
    Jeff Kish
    Oct 21, 2004
  5. John Ryan
    Replies:
    3
    Views:
    464
    Troll_King
    Nov 2, 2003
  6. Replies:
    0
    Views:
    561
  7. Byte

    Small newbie question

    Byte, Feb 12, 2006, in forum: Python
    Replies:
    5
    Views:
    386
    Dennis Lee Bieber
    Feb 12, 2006
  8. Jerry C.
    Replies:
    8
    Views:
    543
    Uri Guttman
    Nov 23, 2003
Loading...