Re: [xsl] Copying Namespace Nodes

Subject: Re: [xsl] Copying Namespace Nodes
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sun, 27 Nov 2011 14:05:57 -0800
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@xxxxxxxxxxxxxxxx>
wrote:
> <a:elem
> B xmlns:a="example.com/ns/a"
> B xsi:type="nsc:foo"
> B xmlns:nsc="example.com/ns/sensitive"
> B xmlns:b="example.com/ns/b"
> B xmlns:c="example.com/ns/c"
> B ...
> B xmlns:z="example.com/ns/z">info</a:elem>

Current Thread