Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2009, 02:10 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default xsl:copy exclude namespace

Hi, take the following example. How to I exclude the namespace from the result?

Code:
<xsl:for-each select=".//com:info">
            <xsl:copy>            
                <xsl:apply-templates/>
            </xsl:copy>
 </xsl:for-each>
Thanks.
 
Old April 21st, 2009, 02:14 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

You can't use xsl:copy if you want to strip the namespace from the com:info element. Use
Code:
<xsl:element name="{local-name()}">
  <xsl:apply-templates/>
<xsl:element>
instead.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old April 22nd, 2009, 07:10 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

As always, thank you!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude a namespace with no prefix bonekrusher XSLT 6 January 23rd, 2009 08:48 AM
xsl:exclude-result-prefixes #all and #default maxtoroq BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 4 July 28th, 2008 12:10 PM
Changing namespace on copy rushman XSLT 2 November 12th, 2007 02:35 PM
Exclude Namespace Atribute bonekrusher XSLT 3 May 4th, 2007 08:18 AM
Namespace copy problem francislang XSLT 3 February 20th, 2006 01:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.