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

Re: [xsl] Comparing attributes and setting the values

Subject: Re: [xsl] Comparing attributes and setting the values
From: "Michael Müller-Hillebrand mmh@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Aug 2014 18:48:42 -0000


It would be more along this:

   <xsl:template match="/">
    	<xsl:variable name="union">
                <xsl:apply-templates select="//Item" mode="step1" />
                <xsl:apply-templates select="document('File2.xml')/*//Item"
mode="step1" />
                <xsl:apply-templates select="$union/*" />

with a special template for that mode "step1":

<xsl:template match="Item" mode="step1">
   <xsl:copy-of select="." />

This way you would collect all <Item> in variable $union in their own, common
tree and then you can expect to have the correct context for preceding

If you are on a tight timeline and the task is above your current knowledge
level you might consider seeking professional help. You should at a minimum
make yourself familiar with the concept of trees, which is required to
understand the axis.


- Michael

Am 21.08.2014 um 11:28 schrieb varun bhatnagar varun292006@xxxxxxxxx

> Hi,
> To join all the Item elements I tried using copy and copy-to elements of xsl
and then I applied the template rules but it did not work.
>  <xsl:template match="/">
>          <A>
>             <target>
> <xsl:copy>
>                  <xsl:apply-templates select="//Item"/>
>                  <xsl:apply-templates
> </xsl:copy>
>              </target>
>          </A>
>      </xsl:template>
> Is this the correct way of doing it? Could anyone please help, I am not able
to proceed :(
> Thanks,
> BR,
> Varun

Current Thread