[xsl] Re: Re: Can one _generate_ namespace nodes?

Subject: [xsl] Re: Re: Can one _generate_ namespace nodes?
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Mon, 24 Feb 2003 21:18:32 +0100
"Joseph Kesselman" <keshlam@xxxxxxxxxx> wrote in message
> Yes, generating the <xsl:stylesheet> explicitly as <newxsl:stylesheet>
> rather than using <xsl:copy> would result in newxsl: being declared at the
> root.
> But then any elements -- or XPaths -- copied from the source stylesheet
> would have the reverse problem; they'd still be using the xsl: prefix and
> would need to declare *that* prefix.

What about the following:

<xsl:stylesheet version="1.0"

  <xsl:output omit-xml-declaration="yes" indent="yes"/>

  <xsl:namespace-alias stylesheet-prefix="newxsl"

  <xsl:template match="/">

    <newxsl:stylesheet version="1.0"


The "newxsl" prefix will be bound to the XSLT namespace and the serializer
will generate the necessary namespace definition. In addition to this, a
definition of the XSLT namespace bound to the prefix "xsl" is also present
in the newxsl:stylesheet.

The result will be:

<newxsl:stylesheet xmlns:newxsl="http://www.w3.org/1999/XSL/Transform";
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

Therefore, any XPath expressions containing the "xsl" prefix will be
evaluated correctly. In the same way, any other necessary prefixes can be
specified on the newxsl:stylesheet element.

Is there an example, which is still problematic?


Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

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

Current Thread