RE: using external document in assertions

Yes, doc() is not allowed in assertions according to the spec: or rather,
the set of accessible documents is empty, therefore the call will always
fail, therefore the assertion will be false.

The WG took the view, I think, that it did not want to open the door to
letting the validity of an element be entirely context-dependent. Clearly
there are use cases, such as code lists, where this is exactly what the user
wants, but it does dramatically change what we mean by validity if it
depends on anything other than the instance document and the schema.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

 

> -----Original Message-----
> From: www-xml-schema-comments-request@w3.org 
> [mailto:www-xml-schema-comments-request@w3.org] On Behalf Of 
> Mukul Gandhi
> Sent: 19 December 2009 11:17
> To: www-xml-schema-comments@w3.org
> Subject: using external document in assertions
> 
> Hi all,
>    While reading through the latest draft of XML Schema 1.1 
> spec, I have a doubt while reading few things here, 
> http://www.w3.org/TR/xmlschema11-1/#ch_xpath (Assertions and XPath).
> 
> There is a point here, which says [1]:
> The rules for the "available collections" and "default collection"
> properties of the [XPath 2.0] dynamic context have been 
> simplified; these properties are now required to be the empty 
> set instead of being .implementation-defined.. This improves 
> interoperability and resolves issue 6540 Available documents 
> in assertions.
> 
> Pls also see, 
> http://www.w3.org/Bugs/Public/show_bug.cgi?id=6540 as pointed 
> by the above paragraph.
> 
> Does this mean, that if an XSD 1.1 implementation allows 
> access to external documents in assertions XPath expressions, 
> then it is non-conformant?
> 
> For e.g, is this assertion (referred from one of Roger L. 
> Costello's XSD 1.1 examples at, 
> http://www.xfront.com/xml-schema-1-1/):
> <assert test="$value = doc('countries.xml')//country" />
> 
> conformant according to the spec?
> 
> It seems to me, that an assertion like this is not conformant 
> now, as per the the reference I've provided from the spec, above [1].
> But just wanted to confirm this from the group, here.
> 
> 
> --
> Regards,
> Mukul Gandhi
> 

Received on Saturday, 19 December 2009 15:14:32 UTC