View Single Post
  #4 (permalink)  
Old October 6th, 2006, 10:49 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

As you don't have any attributes to worry about, nor mixed content, the following should work;
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <xsl:apply-templates select="/*/body/Order"/>
  </xsl:template>
  <xsl:template match="Order">
    <Order xmlns="rrn:org.xcbl:schemas/xcbl/v3_0/xcbl30.xsd">
      <xsl:apply-templates/>
    </Order>
  </xsl:template>
  <xsl:template match="Order//*">
    <xsl:element name="{local-name()}" namespace="rrn:org.xcbl:schemas/xcbl/v3_0/xcbl30.xsd">
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>
I think Michael Kay could produce amore elegant and robust version though.

--

Joe (Microsoft MVP - XML)