[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Merge Two Files
Brad Felix wrote:
File 1 provides the "master" and the result of the merge should look like: The following does that: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="chapter/title"> <xsl:copy> <xsl:text>Business Ethics and Social Responsibility</xsl:text> </xsl:copy> </xsl:template> <xsl:template match="para"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> <xsl:apply-templates select="document('file2.xml')/personalnotes/note[@id = current()/@id]"/> </xsl:template> <xsl:template match="note"> <para role="note"> <xsl:apply-templates select="@* | node()"/> </para> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
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
|