|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Merging two xml files using a template file.
Hi,
I am just trying to make one xsl file. But it fails at line : <xsl:copy-of select="$local/$elemName"/> It says TestNode expected here.... Can't I combine two variables ??? Thanks Bhaskar <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml"/> <!-- load the merge file --> <xsl:variable name="file1" select="document('file1.xml')"/> <xsl:variable name="file2" select="document('file2.xml')"/> <xsl:template match="/"> <xsl:call-template name="copyNode"/> </xsl:template> <xsl:template name="copyNode"> <xsl:for-each select="child::*">
<xsl:variable name="elemName" select="name()"/>
<xsl:choose>
<xsl:when test="@src='file1'">
Inside local
<xsl:copy-of select="$file1/$elemName"/>
</xsl:when>
<xsl:when test="@src='file2'">
Inside Restored
<xsl:copy-of select="$file2/$elemName"/>
</xsl:when>
<xsl:otherwise>
Inside otherwise
<xsl:element name="{$elemName}">
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template></xsl:stylesheet> From: "SHEIKH Sajjad" <Sajjad.SHEIKH@xxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: Merging two xml files using a template file. Date: Mon, 12 Jan 2004 17:46:28 +0100 _________________________________________________________________ Contact brides & grooms FREE! http://www.shaadi.com/ptnr.php?ptnr=hmltag Only on www.shaadi.com. Register now! XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








