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

Copying nodes from source XML to the result tree

Subject: Copying nodes from source XML to the result tree
From: Abhijit Junnare <mavlaabhi@xxxxxxxxx>
Date: Tue, 7 Oct 2003 13:43:42 -0700 (PDT)
xsl copy nodes
I am trying to copy nodes from the source XML to the
output generated using XSL. 
My problem is that all the nodes that I copy have the
namespace attribute attached with them. I am wondering
if there is any alternative to get rid of the
namespace attribute.
Here is my sample code.

INPUT XML
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="temp.xsl"?>
<AssembleRequest xmlns="www.myhome.com">
	<Transaction>
		<TransactionID>111</TransactionID>
	</Transaction>
</AssembleRequest>

STYLEHSEET

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:temp="www.myhome.com"
>

<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
			<xsl:apply-templates
select="temp:AssembleRequest"/>
	</xsl:template>

	<xsl:template match="temp:AssembleRequest" >
		<xsl:element name="TransData">
		<xsl:apply-templates/>		
		</xsl:element>
	</xsl:template>
	
	<xsl:template match="temp:Transaction">
		<xsl:copy/>
		<xsl:copy-of select="node()"/>		
	</xsl:template>

OUTPUT
<?xml version="1.0" encoding="UTF-8"?>
<TransData>
<Transaction xmlns="www.myhome.com" />
<TransactionID
xmlns="www.myhome.com">111</TransactionID>
</TransData>

Is there a way to get rid of the xmlns attribute on
the Trasaction and TransactionID elements.
Also is there a FAQ on copying source nodes to the
result tree using XSL. 
Any help is appreciated.
Thanks


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.