[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Good old namespace problem(slightly different)!!

Subject: Re: Good old namespace problem(slightly different)!!
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 30 Apr 2003 17:32:18 +0100
good .net namespace name

  <xsl:text disable-output-escaping="yes">
 <![CDATA[
<myheader xsi:schemaLocation="www.abc.org/schema/mainschema.xsd"


using d-o-e is almost always the wrong thing to do.

the namespace name is part of the name of the element so
you don't want to 
<xsl:copy-of select="$imported-xml"/>
You want to do as you would have done with any other name change: apply
templates to these nodes that make the change,

<xsl:apply-templates select="$imported-xml/*" mode="x"/>

(you don't need a variable you could just as well go

<xsl:copy-of select="document('imported.xml')/*" mode="x"/>

then something like

<xsl:template mode="x" match="*">
 <xsl:element namespace="www.abc.org" name="local-name()">
  <xsl:copy-of select="@*"/>
  <xsl:apply-templates mode="x"/>
 </xsl:element>
</xsl:template>

the "x" mode just renames any element it finds into the "www.abc.org"
namespace.

Alternatively of course you could add xmlns="www.abc.org" to the top
level element of your imported.xml so the elements were in the right
namespace to start with, then your original stylesheet would work.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.