Re: [xsl] Comparing attributes and setting the values

Subject: Re: [xsl] Comparing attributes and setting the values
From: "varun bhatnagar varun292006@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Aug 2014 09:31:39 -0000
Hi Michael,

Thank you so much for replying.
Yes, I have a deadline :(  and I have been reading a lot of xslt stuff
available on the internet, going through ebooks and online tutorials but I
still have little bit of confusion about xslt tree creation.
I have tried your suggestion out but my xslt processor throws an error. It
is not able to process the stylesheet because of apply-templates part where
you have passed the variable.
<A>
            <target>
                <xsl:apply-templates select="$union/*" />
            </target>
        </A>

And if I try to pass it using <value-of> element then it prints the text
nodes.
Any idea how to fix this?

Thanks,
BR,
Varun


On Thu, Aug 21, 2014 at 8:49 PM, Michael MC<ller-Hillebrand mmh@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Varun,
>
> 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:variable>
>         <A>
>             <target>
>                 <xsl:apply-templates select="$union/*" />
>             </target>
>         </A>
>     </xsl:template>
>
> with a special template for that mode "step1":
>
> <xsl:template match="Item" mode="step1">
>    <xsl:copy-of select="." />
> </xsl:template>
>
> 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 elements.
>
> 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.
>
> HTH,
>
> - Michael
>
>
>
> Am 21.08.2014 um 11:28 schrieb varun bhatnagar varun292006@xxxxxxxxx <
> xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>:
>
> 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 select="document('File2.xml')/
> *//Item"/>
> </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
>
>
>   XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/2562907> (by
> email <>)

Current Thread