[Bug 3486] [XQuery] relative base URI

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3486





------- Comment #4 from davidc@nag.co.uk  2006-08-16 16:21 -------
Thanks for the reply, A couple of points

the base uri declaration text presumably implies a resolution of bug #3485 that
says it's not an error to use a non-absolute URI literal.

The resolution of xml:base is against the static context I now realise that
the XQuery spec is not very clear about how xml:base attributes are supposed to
work.

In 3.7.1 (direct element constructors)
there are two cases, xml:base="...." direct attribute constructors, and
attribute {concat('x','ml:base')}{...} computed attribute constructors.


The base-uri is specified in terms of "the constructed node's attribute named
xml:base" in item 5.b Perhaps this just applies to direct attribute
constructors, as attributes coming from computed attribute constructors in the
content are not attached to the element until step 5.d.

However in 3.7.3.1 (computed element constructors) there is not the possibility
of direct attribute syntax, just computed (or copied) attributes in the content
sequence, however the same text appears, again base-uri is assigned in step b
but attributes are not attached until step d



So I think that I suggest that in both cases base-uri assignment is moved after
attribute assignment, and that it is highlighted more strongly that resolution
is against the base uri in the static context rather than the (dynamic
property) 
the base uri of the element to which this element is being attached.

In the case of direct attribute constructors xml:base="..." there would be the
possibility (similar to the namespace case) that this also affects the base URI
in the static context within the scope of the element constructor. I'm not sure
that (today) I have a strong feeling whether or not it should affect the static
context in ths way, but it would be helpful if the spec said explictly whether
it did or did not.

David




To be more explict, what's the expected answer to this:


declare base-uri "http://a/b/c";

element a {
 attribute xml:base {"../x"},
element b {
 attribute xml:base {"y"}
}}/b/base-uri()

Received on Wednesday, 16 August 2006 16:21:30 UTC