Hi all,
I am sorry if this question is very basic but I am
fairly new with xsl.
I have an xml document with the following structure:
<FpML version="4-0"
xmlns="http://www.fpml.org/2003/FpML-4-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.fpml.org/2003/FpML-4-0
../fpml-main-4-0.xsd
http://www.w3.org/2000/09/xmldsig#
xmldsig-core-schema.xsd" xsi:type="DataDocument">
<trade>
<tradeHeader>
<partyTradeIdentifier>
. . .
I want to copy the entire document (including the
nodes) but changing the namespace, the schema location
attributes, and the version number.
I don?t know how to get rid of the old namespace
declaration.
Here is the xsl I am working on:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fpml="http://www.fpml.org/2003/FpML-4-0"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="fpml fo">
<xsl:template match="fpml:FpML">
<FpML version="4-1"
xmlns="http://www.fpml.org/2004/FpML-4-1">
<xsl:apply-templates
select="./fpml:trade"/>
</FpML>
</xsl:template>
<xsl:template match="fpml:trade">
<xsl:element name="{local-name()}">
<xsl:copy-of select="node()|@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Is there any simple way to do this in xsl?
Thanks in advance for your help,
-Marc
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html