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

Re: selecting specific elements from a second file

Subject: Re: selecting specific elements from a second file
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 17 Dec 2016 15:27:09 -0000
Re:  selecting specific elements from a second file
On 17.12.2016 16:19, Mark Wilson mark@xxxxxxxxxxxx wrote:
I want to select elements from the second file to add to the first file
when their @pofis-number match (in this instance 2966 has a match, 2967
does not.

Well, which XSLT processor do you use, which XSLT version?


With XSLT 2.0 you could define a key

<xsl:key name="flaws" match="Flaws" use="@pofis-number"/>

and then write a template

<xsl:template match="Stamp">
<xsl:copy>
<xsl:apply-templates select="@*, node(), key('flaws', @pofis-number, doc('file2.xml'))/node()"/>
</xsl:copy>
</xsl:template>


together with identity transformation template (or XSLT 3.0 xsl:node on-no-match="shallow-copy").

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.