Re: [xsl] Replacing default namespace

Subject: Re: [xsl] Replacing default namespace
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Sat, 30 Jun 2007 14:32:22 +0200
Scott Sauyet wrote:

The root <definitions> tag in the original WSDL has


Now throughout the document, elements that look like these:

    <xs:simpleType name="addrFormat" .../>
    <service name="SessionsService" .../>

get transformed into these:

    <xs:simpleType xmlns:tns=""; name="addrFormat">
    <service xmlns:tns=""; name="SessionsService">

If you use xsl:copy then namespace nodes are copied through too when an element node is copied. To avoid that use a template like this

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

for element nodes that you want to copy without its namespaces nodes.


	Martin Honnen

Current Thread