Hi:
I have xml1 based on xsd1 and xml2 based on xsd2.
The element "transport" exists in both the xml files even though they are based on different .xsd.
I want to replace the value of the attribute "name" of the "transport" element in xml1 with the one from xml2.
Consider xml1:
<?xml version = '1.0' encoding = 'UTF-8'?>
<
applet locale="en">
<transport name="jrmp"/>
<transport name="codebase"/>
....
...
...
</applet>
----------------------------------------
Consider xml2:
<disco:configuration xmlns:Disco=......................... xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=............... >
....
....
<plus helpSet="help">
<transport name="jrmp"/>
<transport name="http"/>
</plus>
</disco:configuration>
-----------------------------------------
I noticed the following xsl when applied to xml1 would outputs the correct values for the transport element in xml1 --
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:Disco="http://www.oracle.com/discoverer/configuration"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" encoding="ISO-8859-1" indent="yes" />
<xsl:template match="transport">
<xsl:call-template name="copy"/>
</xsl:template>
<xsl:template name="copy">
<xsl:copy>
<xsl:apply-templates select="@*" mode="copy" />
<xsl:apply-templates/>
<xsl:value-of select="text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
-------------------------------------------------
How can I thereafter replace the value for the transport element in xml2 with the values I have from the above transform?
OR
Is there another way to achieve this replacement of element values between 2 xml files based on different schema definitions?
Thanks, N.
_______________________________________________________________________
Edit Comment: Disabled smiles in this post.
- m
[ January 14, 2005: Message edited by: Madhav Lakkapragada ]