xsl-list
[Top] [All Lists]

Re: [xsl] creating a temporary document from multiple inputs

2013-03-09 10:58:25
On Sat, Mar 09, 2013 at 05:30:11PM +0100, Wolfgang Laun scripsit:
See inline.
On 09/03/2013, Graydon <graydon(_at_)marost(_dot_)ca> wrote:
On Sat, Mar 09, 2013 at 05:02:19PM +0100, Wolfgang Laun scripsit:
[snip]
What surprised me was that I could use
 <xsl:sequence select="document($paths)"/>
without an error, which would make the document-nodes of the inputs
children of the temporary document-node. Is the XSL processor clever

Betcha you can't.
What, exactly? Both forms - with and without '/*' - appear to work
correctly - at least the key() function delivers.

Which surprised me, because I wouldn't have expected 

<xsl:sequence select="document($paths)"/>

to work, then I went and looked at the spec for the surrounding
xsl:document, an instruction I don't think I've ever used.

I just wondered why I don't have to select the document-nodes' *children*.

Sequence constructor rules, item 4 -- 

http://www.w3.org/TR/xslt20/#constructing-complex-content

"Any document node within the result sequence is replaced by a sequence
containing each of its children, in document order."

So you just can't put a document node in a document node via any
sequence constructor, which makes sense.

So, yes, processor _has_ to be clever enough, it's in the spec. :)

-- Graydon

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--