Re: Formal semantics of step expressions

Hi Stijn,

A few comments embedded.

On Mon, 2003-11-17 at 04:45, Stijn Vansummeren wrote:
> I have a question concerning the XQuery data model (as described in the formal 
> semantics), and the dynamic semantics of step expressions (also as described 
> in the formal semantics).
> Suppose that the variable $dot is bound to the following value:
> element dummy of type T1 {
>        42 of type xs:integer
> }
> What would the result be of child::node()? Is it 42 of type xs:integer or is 
> it the empty sequence? More specifically, what is is value2 in

It would be in fact text interleaved with pi's and comments (something
like text & pi* & comment&.

This is because of the derivation in [Section Static semantics
of axis], notably the child:: axis in the case where ChildType <:
xdt:anyAtomicType+. The addition of pi's and comment's type comes from
the type adjustment [Section 7.2.6 Type adjustment].

> dynEnv |- axis child:: of element dummy of type T1 { 42 of type xs:integer } 
> => Value2
> And what is Value3 in 
> dynEnv |- test node() with element of Value2 => Value3

Yes I think the dynamic semantics is not right here. In the cases where
the value is an atomic type, we should return a text node with the
'erasure' of the atomic value from the content of the element.

> As far as I can see, the axis judgement only returns element child content in 
> this case, which would result in the empty sequence. Even if it did return 
> the value 42 of type xs:integer, the test judgement would return the empty 
> sequence, since 42 of type xs:integer is an atomic value, not a node. If this 
> reasoning is correct, how would I be able to obtain the entire child value of 
> the value above? 

See above. The spec should be fixed.

> Is it true that the dynamic semantics of step expressions cannot handle atomic 
> values, and therefore does not work on the entire data model? Or is atomic 
> data viewed as being a text node when applying a step expression?

the latter.

Hope this helps,
- Jerome

> --Stijn Vansummeren
> Limburgs Universitair Centrum
> Universitaire Campus 
> Gebouw D
> 3590 Diepenbeek
> Belgium
Jerome Simeon <>

Received on Monday, 17 November 2003 15:52:18 UTC