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

Re: Copy idiom and overriding namespaces: trying to be

Subject: Re: Copy idiom and overriding namespaces: trying to be smart, finding approaches
From: Abel Braaksma Online <abel.online@xxxxxxxxx>
Date: Wed, 26 Jul 2006 22:09:41 +0200
getting ripped off idiom
Hi George,

Thanks for looking into it and remembering. I looked through the thread, and what I understand from it, is that it's basically the same approach I am using. Meaning, that I should feel confident with the current solution as being the right one to use. A copy of my last attempt, leaving out comment nodes and processing instructions:

<xsl:template match="@*" >
<xsl:copy /> </xsl:template>
<xsl:template match="*" >
<xsl:element name="{local-name()}" namespace="{$target-namespace}">
<xsl:apply-templates select="@* | node()" />
</xsl:element>
</xsl:template>


In short, I could conclude that it is not possible to make a template only for namespace nodes and change the result tree namespace when you encounter an input namespace. Use for-each can be used for getting all namespace nodes. Using the above, can be used to create elements that are ripped off of any namespace information, and receive a new namespace instead. Looking again at the above, it doesn't look that hard anymore now... ;)

Cheers,
Abel

George Cristian Bina wrote:

Hi Abel,

Have a look at the following thread from a couple of weeks ago
http://www.biglist.com/lists/xsl-list/archives/200607/msg00133.html
There you can see a stylesheet that changes namespaces and element and attribute names.


Best regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

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.