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

copying xmlns: attribute

Subject: copying xmlns: attribute
From: omprakash.v@xxxxxxxxxxxxx
Date: Thu, 31 Mar 2005 18:35:56 +0530
 copying xmlns: attribute
Hi,

      Got this far by myself.

         Iam using the following code to copy an element along with its
attibutes to the result tree from a context node which is elsewhere in the
document. The context node is in fact the root element. However, the xmlns:
attribute is not getting copied.

   <xsl:template match="/">
     <xsl:for-each select="//root/*[1]">
     <xsl:variable name="rootnode" select="name(.)"/>
     <xsl:element name="{$rootnode}">
     <xsl:copy-of select="@*"/>
     <xsl:apply-templates select="/" mode="inside">
          <xsl:with-param name="rootnode" select="$rootnode"/>
     </xsl:apply-templates>

     </xsl:element>
     </xsl:for-each>
   </xsl:template>


I have used xsl:copy-of select="@*" earlier and I know that it copies
xmlns: attributes.
Also, in the inner call to apply-templates, I have to select "/" once again
with a different mode as otherise only one node is getting copied if I use
@*|node()

My xhtml snippet is as follows:

<table>
<tr>
<root>
<slideshow xmlns="urn:hl7-org/v3" title="Sample Slide Show" date="Date of
publication" author="Yours Truly">
<td><a href="file:///">

:
:
:

</slideshow>

Hoping to get a quick reply.

Cheers,
Omprakash.V













This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

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.