Re: [xsl] Get value from update.xml and stored in source.xml(update source.xml)

Subject: Re: [xsl] Get value from update.xml and stored in source.xml(update source.xml)
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Thu, 08 Sep 2005 12:09:30 +0200
On Wed, 08 Sep 2004 11:40:56 +0200, Shailesh <> wrote:

I have used posted xml and xslt.
I have written a small code in VB.NET which takes input as "xml" file and
for transformation "xslt" and does the transformation which will output an xml file.


What version of msxml do you use?

Please run this diagnosing stylesheet and post the output.

<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:output method="xml" indent="yes"/>

<xsl:variable name="update" select="document('update.xml')"/>
<xsl:key name="id" match="*" use="@id"/>

<xsl:template match="/">
<test>
	<source.xml>
		<xsl:copy-of select="/"/>
	</source.xml>
	<source.xml>
		<xsl:copy-of select="$update"/>
	</source.xml>
	<output>
		<xsl:apply-templates/>
	</output>
</test>
</xsl:template>


<xsl:template match="*[@id]">
<xsl:variable name="id" select="@id"/>
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:comment>Looking up <xsl:value-of select="local-name()"/> (id = '<xsl:value-of select="@id"/>')</xsl:comment>
<xsl:comment>With raw xpath:</xsl:comment>
<xsl:copy-of select="$update//*[@id=$id]/*"/>
<xsl:comment>With a key:</xsl:comment>
<xsl:for-each select="$update">
<xsl:copy-of select="key('id',$id)/*"/>
</xsl:for-each>
</xsl:copy>
</xsl:template>


<xsl:template match="node()|@*">
	<xsl:copy>
		<xsl:apply-templates select="node()|@*" />
	</xsl:copy>
</xsl:template>

</xsl:stylesheet>

--
"NN= N?N/N4N1 OON9 N?ON4N-N= N?N/N4N1"  - N#O	N:ON1ON7O

Current Thread