xsl-list
[Top] [All Lists]

Re: [xsl] Replacing default namespace

2007-06-30 05:32:49
Scott Sauyet wrote:

The root <definitions> tag in the original WSDL has

     xmlns:tns="http://tempuri.org/";

Now throughout the document, elements that look like these:

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

get transformed into these:

    <xs:simpleType xmlns:tns="http://tempuri.org/"; name="addrFormat">
    <service xmlns:tns="http://tempuri.org/"; 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()"/>
    </xsl:element>
  </xsl:template>

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


--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>