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

Re: Re: Can one _generate_ namespace nodes?

Subject: Re: Re: Can one _generate_ namespace nodes?
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Mon, 24 Feb 2003 21:18:32 +0100
dymmy
"Joseph Kesselman" <keshlam@xxxxxxxxxx> wrote in message
news:OF61D39BC9.77924166-ON85256CD7.00611483-85256CD7.0062E761@xxxxxxxxxxxxx
> 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"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:newxsl="http://dymmy/Transform"
>

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

  <xsl:namespace-alias stylesheet-prefix="newxsl"
                       result-prefix="xsl"/>

  <xsl:template match="/">

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

  </xsl:template>
</xsl:stylesheet>

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">
   <newxsl:text>foo</newxsl:text>
</newxsl:stylesheet>

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?




=====
Cheers,

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






 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.