xsl-list
[Top] [All Lists]

Re: [xsl] node kind of result tree

2013-01-21 17:45:56

Ah, thanks David - I must have been confused. Somewhere I seemed to remember having to deal with the possibility that an XSL transformation could produce a sequence. Yes, here it is in the javadoc of JDOMResult:

 * A holder for an XSL Transformation result, generally a list of nodes
 * although it can be a JDOM Document also. As stated by the XSLT 1.0
* specification, the result tree generated by an XSL transformation is not * required to be a well-formed XML document. The result tree may have "any
 * sequence of nodes as children that would be possible for an
 * element node".

Can you place that in proper perspective for us? Under what circumstances would we expect to get a sequence of nodes (not a document) from XSLT?


The result of an XSLT transformation, according to the spec, is always a document node. It is not necessarily a well-formed document; it may be a document node with several element node (and other) children. And of course an API might present this result to your application in all kinds of different ways, for example it might strip of the document node and just give you the elements. That might be necessary if the result is delivered using a data model such as JDOM which might not reflect the XDM model used in the spec exactly.

Michael Kay
Saxonica


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>