Vivek_Nagasundara wrote:

  Hi,

  A couple of remarks.

  This is a general purpose XQuery question, I guess this is best to
rather ask the XQuery Talk list.

> I want to parse the content and retrieve the AssignTime and Job of
> the Owner whose DeliveryTime is NULL using the below mentioned
> XQuery.

  "DeliveryTime is NULL" does not make sense in XQuery.  What you want
is the Owner with an empty DeliveryTime.  In XML, often, NULL is
better represented by no element at all than by an empty element.

> for $x in
> doc("/Book.xml")/Book/chapt...@number="One"]/conte...@info="Dot
> Net Overview"]
> where $x//DeliveryTime=""

  You select a Content element, for which a the string value of one
descendant element named DeliveryTime is the empty string.  I thing
you should use DeliveryTime[empty(node())] instead.  And you select
the Content element, then...

> <Root>
> {
> <AssignTime>{data($x/own...@name="shaun"]/
> AssignTime)}</ AssignTime >,
> <Job>{data($x/own...@name="
> shaun"]/Job)}</Job>
> }
> </Root>

you select all its Owner for a given name, without checking the
DeliveryTime.  So I would remove the where clause above and use
instead:

    <Root> {
      let $shaun := $x/own...@name eq 'shaun'][empty(DeliveryTime/node())]
        return ($shaun/AssignTime, $shaun/Job)
    }
    </Root>

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/


























_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to