W3C home > Mailing lists > Public > www-xml-xinclude-comments@w3.org > May 2000

Using XInclude with XSLT transformations

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Wed, 17 May 2000 14:57:44 +0200
Message-ID: <39229748.E9EF9ACE@dyomedea.com>
To: www-xml-xinclude-comments@w3.org
A long discussion is taking place on the XSL-LIST about the usage
of external parsed entities with XSLT and the question might be : 

"will XInclude work better than external parsed entities with XML 
tools such as XSLT ?".

Using external parsed entities to include sub-documents is a common
practice which is illustrated [1], for instance, by the docbook 

Transformation tools based upon standard XML parsers which silently
resolve the external entities references, such as XSLT, can't be used to
transform documents containing external parsed entities without losing
the document include structure.

A common practice [2] used as a workaround is to create links in your 
documents and to switch between documents in your transformation, 
the downside being that you are losing the possibility to do global 
XPath queries on multiple documents.

While the syntax of this simple mechanism is in many ways similar to
XInclude, the XInclude Working Draft describes the merge of the included
documents as transparent for the application :

"The acquired infoset is merged with the source infoset to create a new
infoset by replacing the information items representing the
xinclude:include elements with information items in the acquired
infoset. The xinclude:include element, its attributes and any children,
are not represented in the result infoset."

Following this rule in a XSLT transformation wouldn't allow to handle
XInclude any better than external parsed entities. 

While I don't see any easy solution to this problem, as a XSLT user, I
think the inclusion process should add extra nodes to the XPath Object
Model and (maybe though a new axis), to optionally specify if you want
to access the merged or the initial infoset.

Best regards

Eric van der Vlist

References :
[1] http://www.mulberrytech.com/xsl/xsl-list/archive/msg12531.html
[2] http://www.mulberrytech.com/xsl/xsl-list/archive/msg12538.html
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
Received on Wednesday, 17 May 2000 08:55:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:28 UTC