This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: seamless processing of multiple XML fragments
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] seamless processing of multiple XML fragments
- From: "Aleksei Valikov" <valikov at fzi dot de>
- Date: Mon, 3 Sep 2001 20:50:44 +0200
- References: <20010903182802.62032.qmail@web12606.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi.
> The tag <include file="File2.xml"/> conceptually shows where the xml
> fragment in the second file should be inserted into xml fragment in
> the first file. I could accept any mechanism that allows this type
> of insertion. Here is my questions to the list: Is there a way to
> implement this so that the XSLT processing is seamless? I don;t
> want to concern myself with tracing nested includes in writing the
> XSLT. Your help is appreciated.
In 1.0 best solustion is transforming in two steps - first process includes,
then process generated utited file.
Otherwise you could not get your document conceptually united - you will
still have to operate on two documents.
You may be content with something like
<xsl:template match="include">
<xsl:for-each select="document(string(@file))">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:template>
This will process templates on you files as if they were united, but
location path will still return include elements where they are.
You may also think of entity solution. declare yur doc as an entity and use
&mydoc; instead your include. This will untite documents and represent them
as single tree.
With later versions, you may first create a united tree in a variable and
then process that tree. It is also possible with 1.0 but with the help of
nodesetfuction extension.
Bye.
/lexi
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list