Re: NIST test 33 and non-existent subresources

On Sat, Jun 07, 2003 at 03:38:01PM -0400, Elliotte Harold wrote:
> 
> NIST test 33 points to a subresource that doesn't exist using an element 
> scheme:
> 
> <include xmlns="http://www.w3.org/2001/XInclude"
>       href="../ents/ptrtst.xml#element(chapter)"/>
> 
> It claims this is a fatal error. I don't think this is obvious based on 
> section 4.1. Since an XPointer may select multiple nodes from an XML 
> document, it seems reasonale that it may also select nothing. The 
> XPointer element framework spec states "failure to identify an element 
> results simply in no subresource being identified by this pointer part 
> rather than an XPointer Framework error." Thus I'm not sure that this 
> should really throw a fatal error rather than simply including nothing. 
> If it is the intention that this throw a fatal error, then section 4.1 
> of the XInclude spec should spell this out more explicitly.

  Problem is that in that case all xpointer scheme evaluations failed.
The Xpointer framework spec section 3.3 Scheme-Based Pointer

"When multiple pointer parts are provided, an XPointer processor must
evaluate them in left-to-right order. If the XPointer processor does not
support the scheme used in a pointer part, it skips that pointer part. If
a pointer part does not identify any subresources, evaluation continues
and the next pointer part, if any, is evaluated. The result of the first
pointer part whose evaluation identifies one or more subresources is
reported by the XPointer processor as the result of the pointer as a
whole, and evaluation stops. If no pointer part identifies subresources,
it is an error."

 all schemes have been evaluated, none identified a subresource, it's
an XPointer error. 
 I think the wording you pointed is needed to avoid generating an XPointer
error when one scheme fails but another may suceed, like

  #xpointer(id('foo'))xpointer(//*[@id='foo'])

  you don't want xpointer(id('foo')) failure to locate a subresource to
actually lead to a full XPointer evaluation error. The error is only
raised if all schemes failed.

  IMHO and assuming XPointer didn't change too much since I worked on it :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | 

Received on Wednesday, 11 June 2003 14:06:18 UTC