[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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").
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|