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

RE: Add namespace to element name itself

Subject: RE: Add namespace to element name itself
From: "V.Ramkumar" <v.ramkumar@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Nov 2008 18:07:15 +0530
RE:  Add namespace to element name itself
>You'll have to tell us more precisely (a) what you are doing, and (b) what
>output you actually do want.

Dear Michael,
I am doing XML (input) to XML (output) Transformation using saxon9.

I have to add namespace to output XML name itself in transformation.

I need like this <ce:pii>.

I am giving here, some parts of the sample file. I have to add some
namespace to output xml by using xslt transform.

I have to add namespace for some root elements not for all elements.

How to add namespace to all the elements of the parent. By matching single
parent element, like the below,
 My input XML contains,
 		<copyright type="unknown" year="2008"/>
 Required output XML,
 		<ce:copyright type="unknown" year="2008"/>
 My XSL:
 	<xsl:template match="*">
 			<xsl:copy-of select="@*"/>
	<xsl:template match="pii"><xsl:element
name="ce:{local-name()}"><xsl:apply-templates select="@*|node()"
	<xsl:template match="doi"><xsl:element name="ce:{local-name()}"
namespace="uri"><xsl:apply-templates select="@*|node()"
	<xsl:template match="copyright"><xsl:element
name="ce:{local-name()}" namespace="uri"><xsl:apply-templates
select="@*|node()" /></xsl:element></xsl:template>

Current Thread


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.
First Name
Last Name
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.