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 September 7th, 2004, 06:42 AM
Authorized User
 
Join Date: Sep 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Removing Namespaces from XSL Transform output

Does anyone know of a way to remove namespaces?

I've recently created an XSL to transform another piece of XML but the result includes two namespaces that I do not want.

<?xml version="1.0" ?>
<ROOTNODE xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:Testing="urn:my-scripts">

All I want is;

<?xml version="1.0" ?>
<ROOTNODE>

Any help would be most appreciated.

Cheers,
Francis

 
Old September 7th, 2004, 07:21 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If the unwanted namespaces got there from the stylesheet, use exclude-result-prefixes attribute on the xsl:stylesheet element. If they got there from the source document, use xsl:element to create new elements instead of xsl:copy.

Michael Kay
http://saxon.sf.net/
 
Old September 7th, 2004, 07:58 AM
Authorized User
 
Join Date: Sep 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Transform String, Removing Characters. v01 XSLT 3 November 21st, 2008 01:58 PM
Removing namespaces without escaping CDATA??? ypomonh XSLT 5 April 8th, 2007 05:11 PM
xsl:output and removing space in XML ROCXY XSLT 1 March 21st, 2006 09:38 AM
namespaces appearing in tags after XSL translation mphare XSLT 4 February 20th, 2006 03:49 PM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





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