Focus-sensitive numeric predicate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Focus-sensitive numeric predicate

Charles Brooking

Hi all,

Am I correct in supposing [1] that the following (spectacular) query
will return nothing?

    declare variable $Products :=
      <Products>
        <Product><ProductID>2</ProductID><Title>foo</Title></Product>
        <Product><ProductID>1</ProductID><Title>bar</Title></Product>
      </Products>;
   
    $Products/Product[data(ProductID) cast as xs:integer]/Title

I'll say no more... :-)

Later
Charlie

[1] http://www.w3.org/TR/xquery/#id-predicates

--
Charles Brooking
Associate Software Engineer
Canon Information Systems Research Australia


Reply | Threaded
Open this post in threaded view
|

RE: Focus-sensitive numeric predicate

Michael Rys

Correct. That is already true in XPath 1.0...

Best regards
Michael

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
Of

> Charles Brooking
> Sent: Thursday, November 24, 2005 5:05 PM
> To: W3C Query Langauages
> Subject: Focus-sensitive numeric predicate
>
>
> Hi all,
>
> Am I correct in supposing [1] that the following (spectacular) query
> will return nothing?
>
>     declare variable $Products :=
>       <Products>
>         <Product><ProductID>2</ProductID><Title>foo</Title></Product>
>         <Product><ProductID>1</ProductID><Title>bar</Title></Product>
>       </Products>;
>
>     $Products/Product[data(ProductID) cast as xs:integer]/Title
>
> I'll say no more... :-)
>
> Later
> Charlie
>
> [1] http://www.w3.org/TR/xquery/#id-predicates
>
> --
> Charles Brooking
> Associate Software Engineer
> Canon Information Systems Research Australia
>