xsl-list
[Top] [All Lists]

Re: [xsl] Copying Namespace Nodes

2011-11-27 16:06:29
Hopefully, you'd not consider this verbose () the namespace prefixes
"a" and "xsi" have to be bound to the right namwspaces somewhere in
your stylesheet):

 <xsl:template match="a:elem">
  <xsl:element name="{name()}"
               namespace="example.com/ns/a">
  <xsl:copy-of select=
  "namespace::*[name() = ('xsi', 'nsc')]
  |
   @xsi:type
  "/>
   <xsl:apply-templates/>
  </xsl:element>
 </xsl:template>


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.


On Sun, Nov 27, 2011 at 1:10 PM, Heiko Niemann 
<kontakt(_at_)heiko-niemann(_dot_)de> wrote:
<a:elem
 xmlns:a="example.com/ns/a"
 xsi:type="nsc:foo"
 xmlns:nsc="example.com/ns/sensitive"
 xmlns:b="example.com/ns/b"
 xmlns:c="example.com/ns/c"
 ...
 xmlns:z="example.com/ns/z">info</a:elem>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--