Re: [xsl] exsl:document help

Subject: Re: [xsl] exsl:document help
From: "Werner, Wolfgang" <mail@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Sep 2004 23:53:55 +0200
Hi Greg,

is seems like you generate the the document "a2" twice. The second time you generate it you overwrite the contents of the first run.

<xsl:template match="CCC">
    <exsl:document href="{../../@id}" method="text">
      	<xsl:for-each select='../..//CCC'>
	    <xsl:value-of select="."/>
	</xsl:for-each>
    </exsl:document>
</xsl:template>

That should do the job. I'd rewrite the templates so you don't have to step up two levels each time:

  <xsl:template match="/">
    <xsl:apply-templates select="AAA"/>
  </xsl:template>

  <xsl:template match="AAA">
    <exsl:document href="{@id}" method="text">
      <xsl:for-each select='descendant::CCC'>
	    <xsl:value-of select="."/>
	</xsl:for-each>
    </exsl:document>
  </xsl:template>

Regards,
Wolfgang

Current Thread