Re: [xsl] Two different input get single output

Subject: Re: [xsl] Two different input get single output
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 07 Dec 2009 13:43:17 +0100
Selvaganesh wrote:

I have challenging for xsl creating of two different input xml and get
single output xml file. Can you guide us how is prepare in easy way.

This XSLT 2.0 stylesheet:


  <xsl:param name="url2" as="xsd:string" select="'test2009120703.xml'"/>
  <xsl:variable name="doc2" select="doc($url2)"/>

<xsl:key name="k1" match="definition" use="term"/>

<xsl:output indent="yes"/>

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

<xsl:template match="section">
<xsl:value-of select="concat('Subsection ', content)"/>
<xsl:apply-templates select="type"/>
<xsl:value-of select="key('k1', tokenize(origin, ', '), $doc2)/def" separator=", "/>

  <xsl:template match="section/type[not(normalize-string)]">
    <xsl:text> replace, </xsl:text>

  <xsl:template match="section/type[. = 'Drafting']">
    <xsl:text> was created in drafting, </xsl:text>

  <xsl:template match="section/type[. = 'New']">
    <xsl:text> is a new provision, </xsl:text>


creates the following result:

<derivation>Subsection (1) replace, Finance Act</derivation>
<derivation>Subsection (2) was created in drafting, Finance Act, Caravan Sites Act</derivation>
<derivation>Subsection (3) is a new provision, Caravan Sites Act, Income and
Corporation Taxes Act</derivation>

The Subsection numbers are different from what you asked for but I could not see where those numbers in your posted output come from. If you can't fix the stylesheet yourself then please explain where those numbers come from.


	Martin Honnen

Current Thread