This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: recursively including xml-files
- To: xsl-list at mulberrytech dot com
- Subject: Re: recursively including xml-files
- From: Eric van der Vlist <vdv at dyomedea dot com>
- Date: Wed, 02 Feb 2000 19:20:53 +0100
- Organization: Dyomedea
- References: <NDBBLHENDIFCGIAGGNLNGEECCBAA.rainer_kerl@hpl.hp.com>
- Reply-To: xsl-list at mulberrytech dot com
You shouldn't do <xsl:copy-of select="document(self::node())"/> on the
included file, but, again apply the templates which will trigger the
<xsl:template match="my-include"> when necessary.
Eric
Rainer Kerl wrote:
>
> hello,
>
> i would like to write a template which is able to include xml-files
> into another xml-file. the file which should be included is specified
> by some kind of 'link'. an example:
>
> a.xml
>
> <hello>
> <my-include>b.xml</my-inlcude>
> </hello>
>
> b.xml
>
> <my>friend</friend>
>
> result:
>
> <hello>
> <my>friend</friend>
> </hello>
>
> i have a working template for that:
>
> <xsl:template match="my-include">
> <xsl:copy-of select="document(self::node())"/>
> </xsl:template>
>
> <xsl:template match="*|@*|comment()|processing-instruction()|text()">
> <xsl:copy>
> <xsl:apply-templates
> select="*|@*|comment()|processing-instruction()|text()"/>
> </xsl:copy>
> </xsl:template>
>
> now, my problem. what if b.xml has also a <my-include>-element?
> how do i recursively include this files? is this possible?
> it would be very nice, if somebody could give me a hint.
> thanks.
>
> rainer
>
> Rainer Kerl mailto: rainer_kerl@hpl.hp.com
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
------------------------------------------------------------------------
Eric van der Vlist Dyomedea
http://www.dyomedea.com http://www.ducotede.com
------------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list