[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Selecting the value from diff i/p XML

Subject: RE: Selecting the value from diff i/p XML
From: Shashank Jain <shashankjain@xxxxxxxx>
Date: Thu, 16 Sep 2010 09:20:25 -0500
RE:  Selecting the value from diff i/p XML
Thanks Gerrit, Hermann, Bauman and Mukul for helping me out.

The 3 argument Key function is really cool, but for some reason I am not
getting any output with that.
I am trying to run that in the latest version of XML Spy and also tried using
Saxon9he processor.

I was able to get the desired output using Bauman's  solution.
I tweaked the code little bit and put an if condition so that it gives me the
values of the ID's which are matched.

<xsl:template match="/">
   <wrapper>
     <xsl:apply-templates select="root2/data"/>
   </wrapper>
</xsl:template>

<xsl:template match="data">
  <out>
   <xsl:if test="$data/root1/item[@id=current()/@id]">
    <xsl:value-of select="@id"/>
    <xsl:text>=</xsl:text>
    <xsl:value-of select="$data/root1/item[@id=current()/@id]/@value"/>
    <br/>
   </xsl:if>
  </out>
</xsl:template

Mukul, I think you missed that I want to apply my XSLT on Root2.xml.
but thanks for your help :-)

Thanks again,

Shashank Jain



----------------------------------------
> From: gandhi.mukul@xxxxxxxxx
> Date: Thu, 16 Sep 2010 09:08:01 +0530
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Selecting the value from diff i/p XML
>
> On Thu, Sep 16, 2010 at 6:14 AM, Mukul Gandhi  wrote:
> > 2.0
>
> >
>
> here the loop is linear too (i.e a linear traversal from user
> perspective -- though in memory real traversal algorithm could be XSLT
> processor specific), but the value lookup by 'key' here is indexed by
> the XSLT processor (the internals of this is again processor
> specific), which usually performs faster for large data sets.
>
>
>
> --
> Regards,
> Mukul Gandhi

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.