|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: adding a namespace to a stylesheet automatically
Yeah, I've done some playing with this a little while back. Try this
out:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:param name="prefix">prefix</xsl:param>
<xsl:param name="namespace">www.namespace.com</xsl:param>
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{$prefix}:{local-name()}"
namespace="{$namespace}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I've not used it in a while, but from what I remember it worked fine.
It doesn't prefix the attributes, though - only the elements.
Allan
|-----Original Message-----
|From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Lars Huttar
|Sent: 29 October 2003 00:05
|To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|Subject: RE: adding a namespace to a stylesheet automatically
|
|
|> This is of course the scenario that motivated
|> xpath-default-namespace in
|> XSLT 2.0.
|>
|> Michael Kay
|
|Yes. I'm wondering if anyone has written a solution to make do
|for XSLT 1.0.
|
|Any pointers to open-source software that makes use of an
|XPath parser to do similar operations would be appreciated.
|
|Lars
|
|
| XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
|
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
|

Cart








