Subject: Re: numbering and document()
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 22 Aug 2003 19:26:35 +0200
|
Please, ignore my erroneous reply -- it was not to this message.
Dimitre.
"Felix Breuer" <felix@xxxxxxxxxx> wrote in message
news:1061569227.4072.32.camel@xxxxxxxx
> Hello!
>
> The XML DT I am creating a stylesheet for has an
>
> <include file="sub.xml"/>
>
> element, which can be used to include sub.xml seamlessly in the main
> document. Now, suppose the documents look like this
>
> main.xml:
> -----------------------------
> <doc>
> <section/>
> <section/>
> <include file="sub.xml"/>
> <section/>
> </doc>
> -----------------------------
>
> sub.xml:
> -----------------------------
> <doc>
> <section/>
> <section/>
> </doc>
> -----------------------------
>
> and my stylesheet is supposed to number the sections in these documents
> in the following way:
>
> 1 Section
> 2 Section
> 3 Section <--- from sub.xml
> 4 Section <--- from sub.xml
> 5 Section
>
> whereas 4 and 5 are from sub.xml. I tried to achieve this using the
> following templates:
>
> <xsl:template match="section>
> <xsl:number/> Section
> </xsl:template>
>
> <xsl:template match="include">
> <xsl:for-each select="document(@file)/doc/*">
> <xsl:apply-templates select="self::section"/>
> </xsl:for-each>
> </xsl:template>
>
> but the numbering I get, is
>
> 1 Section
> 2 Section
> 1 Section <--- from sub.xml
> 2 Section <--- from sub.xml
> 3 Section
>
> I am at a loss as to how to solve this problem. If anybody has an idea,
> please tell me.
>
> Thanks in advance,
> Felix Breuer
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|