RE: [xsl] Creating namespace declarations

Subject: RE: [xsl] Creating namespace declarations
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 13 Jun 2001 11:34:30 +0100
> this is more a request for confirmation than a real question ...
> Am I right, that there's no way in XSLT 1.0 to create
> <example xmlns:ns="urn:namespace" value="ns:something" />
> if "urn:namespace" should be provided as a parameter (i.e.
> there aren't
> namespace nodes for this namespace, neither in the XML source
> nor in the stylesheet).
You are right. The requirement is recognized in the published XSLT 2.0

You can get close in XSLT 1.0 (+errata) by creating an external document

<doc xmlns:ns="urn:namespace/>

and doing

  <xsl:copy-of select="document('dd.xml')/doc/namespace::ns"/>
  <xsl:attribute name="value">ns:something</xsl:attribute>

But it's probably simpler to create a dummy attribute in the required

Mike Kay
Software AG

 XSL-List info and archive:

Current Thread