[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Concatenating multiple input documents into a single node-set


Subject: Re: [xsl] Concatenating multiple input documents into a single node-set
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 May 2004 06:40:47 +0800

Remove the <xsl:copy> ... if you don't want it, don't ask for it to be copied:

<xsl:template match="rng:include">
  <xsl:apply-templates select="document(@href)" />
</xsl:template>

I hope this helps.

....................... Ken

At 2004-05-11 09:14 -0700, Chris von See wrote:
I suspect I did a very poor job of explaining what I wanted... let's try
again...

Basically what I'm trying to do is "expand" a RELAX-NG schema so that all of
the includes are merged in-place into the main part of the schema.  If I
understand your example correctly, what you're proposing would work for those
includes that are in the main schema document, but includes that are nested
inside other included documents would not get expanded.  It sounds like I
can solve this problem by wrapping your solution (or something like it) in a
template which selected on rng:include, e.g.:

<xsl:template match="rng:include">
  <xsl:copy>
    <xsl:apply-templates select="document(@href)" />
  </xsl:copy>
</xsl:template>

This should include the content of each include, in document order. BUT... if
I do this, it looks like I'll get the <include> element in my output in
addition to the content of the included document, e.g.:


<include href="whatever.rng">
  ... content from included document
</include>

How would you suggest I avoid generating the enclosing <include> element?  Is
there a better way to do this?


Cheers Chris


--
Public courses: Spring 2004 world tour of hands-on XSL instruction
Next: 3-day XSLT/XPath; 2-day XSL-FO - Birmingham, UK June 14,2004

World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


Current Thread
Keywords