[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

changing the namespace of a document and copy everthin

Subject: changing the namespace of a document and copy everthing...
From: marc gratacos <marcgratacos@xxxxxxxxx>
Date: Mon, 29 Mar 2004 06:34:09 -0800 (PST)
fpml xsl
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 dont 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.