[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Good old namespace problem(slightly different)!!
<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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|