Hi all,
I've a XML structure here.
<Book>
<Chapter Number="One" status="pending">
<Content info="Dot Net Overview" status="WIP">
<Owner name="shaun">
<Job>Journalist</Job>
<AssignTime>3/4/2009 5:45:38 PM</ AssignTime>
<DeliveryTime>3/4/2009 5:53:53 PM</ DeliveryTime>
</Owner>
<Owner name="mark">
<Job>Reader</Job>
< AssignTime>3/4/2009 5:53:53 PM</ AssignTime>
< DeliveryTime>3/4/2009 5:54:57 PM</ DeliveryTime>
</Owner>
<Owner name="shaun">
<Job> Journalist </Job>
<AssignTime >3/4/2009 5:54:57 PM</ AssignTime>
<DeliveryTime/>
</Owner>
</Content>
</Chapter>
</Book>
I want to parse the content and retrieve the AssignTime and Job of the Owner
whose DeliveryTime is NULL using the below mentioned XQuery.
for $x in doc("/Book.xml")/Book/chapt...@number="One"]/conte...@info="Dot Net
Overview"]
where $x//DeliveryTime=""
return
<Root>
{
<AssignTime>{data($x/own...@name="shaun"]/ AssignTime)}</ AssignTime >,
<Job>{data($x/own...@name=" shaun"]/Job)}</Job>
}
</Root>
Note: Owner Node with attribute name shaun is repeated. The above XQuery hence
provides a multiple values including the first node
So can you suggest a XQuery with a result set that retrieves only the
particular AssignTime whose DeliveryTime is NULL and not both
Regards,
Vivek N
________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE
COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the
sender by email and delete all copies; your cooperation in this regard is
appreciated.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general