Re: No-fail `document` Function Spec
Mike Brown <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <[email protected]> |
John L. Clark wrote:
> I decided to move forward with a new draft of the spec that includes a
> clarification of document identity, my idea for an attempt number (which
> I call a "retry index" in the spec) that I think complements document
> identity issues nicely, as well as some other clarifications.
>
> The updated draft source should be attached along with an HTML view. I
> look forward to your comments.
I like the retry index idea, although I would just call it 'attempt'
since the first try wouldn't be a 're'-try :)
This example has a problem:
generate-id(res:document("foo.xml"))=generate-id(res:document("foo.xml"), ., 1)
The 2nd argument, from which the base URI is derived, defaults to the
stylesheet node containing the res:document() call. This is not the context
node (.), so the statement above won't necessarily be true.
It would be true if you wrote
generate-id(res:document("foo.xml"), .)=generate-id(res:document("foo.xml"), ., 1)
however.
Also in reference to the second argument, the document() function says:
"It is an error if the second argument node-set is empty and the URI reference
is relative; the XSLT processor may signal the error; if it does not signal
an error, it must recover by returning an empty node-set."
Do you want res:document() to return an empty node-set in this case, or
a result:error element? If result:error, then what should the uri attribute
contain?
Finally, just a minor copyedit:
"then define the encapsulated node-set to be" -> "then the encapsulated node-set is"
Mike