[Bug 3070] How does "embedded simplified" work?

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





------- Comment #3 from mike@saxonica.com  2006-04-13 15:23 -------
>Part 3.11 begins with a bullet list of two forms of embedding that are
>possible, neither of which is a simplified stylesheet.

Fair comment. (This is very old text - I've no idea what the reference to
embedding in a non-XML resource is getting at, but it's straight from 1.0)

>we want to know how one would determine the boundaries of the
stylesheet module(s) in an XML document

I think it's up to the user invoking a transformation to identify the
stylesheet they want to use (by identifying the element at the root of the tree
containing the stylesheet module), and it's then up to the processor to check
that this tree represents a valid stylesheet module. It's valid if (as a
minimum) the element identified is xsl:stylesheet or xsl:transform or is
something not in the XSLT namespace but having an xsl:version attribute.

>If a standalone standard stylesheet has no
template for match="/" and has an xsl:include referencing the file below (the
whole file, without a fragment identifier), what do we expect?

An error. The outermost element of this document has no xsl:version attribute,
therefore it is not a stylesheet.

>Next question: same as above, but xsl:version="2.0"

In this case it is a valid stylesheet, it is transformed into a "standard"
stylesheet using the transformation in 3.7, and all is well.

>Next question: if the xsl:include supports fragment identifiers, what if <foo>
is indicated as the start of the fragment?

If the result of the URI dereferencing is an element rather than a document,
then we try to apply the transformation in 3.7 to that element. If the element
has no xsl:version attribute then this transformation will fail to produce a
valid (standard) stylesheet module, so it's an error.

Michael Kay

Received on Thursday, 13 April 2006 15:23:49 UTC