Subject: [xsl] namespace change, what am I missing here? From: S Woodside <sbwoodside@xxxxxxxxx> Date: Sun, 29 Jun 2003 03:17:50 -0400 |
%%%%%%%% cat renamespace.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:param name="location"/> <xsl:param name="new_namespace"/>
<xsl:template match="*" mode="renamespace"> <xsl:element name="{local-name()}" namespace="{$new_namespace}"> <xsl:copy-of select="@*"/> <xsl:apply-templates mode="renamespace"/> </xsl:element> </xsl:template>
%%%%%%%% cat test.orig.xml <?xml version="1.0"?> <rss version="2.0"> <channel> <title>Werblog</title> <link>http://werbach.com/blog/</link>
</channel> </rss>
%%%%%%%% xsltproc --stringparam "new_namespace" "foo" \ renamespace.xsl test.orig.xml <?xml version="1.0"?> <rss xmlns:ns2="foo" version="2.0"> <ns2:channel> <ns2:title>Werblog</ns2:title> <ns2:link>http://werbach.com/blog/</ns2:link>
</ns2:channel> </rss>
<?xml version="1.0"?> <ns2:rss xmlns:ns2="foo" version="2.0"> <ns2:channel> <ns2:title>Werblog</ns2:title> <ns2:link>http://werbach.com/blog/</ns2:link>
</ns2:channel> </rss>
-- www.simonwoodside.com -- 99% Devil, 1% Angel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] msxml dependencies, David Carlisle | Thread | [xsl] Re: namespace change, what am, Dimitre Novatchev |
[xsl] Re: Binary characters in XML, Dimitre Novatchev | Date | [xsl] Re: namespace change, what am, Dimitre Novatchev |
Month |