[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Newbie Namespace Problem in Meta-XSL


Subject: RE: [xsl] Newbie Namespace Problem in Meta-XSL
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 16 Jul 2003 16:56:32 +0100

The chances are you only need the MSXML namespace to be declared because
you are writing an element or attribute whose name is in that namespace.
When you output the element or attribute, the namespace declaration will
be added automatically. It might not be on the xsl:stylesheet element
where you want it, but that won't matter to the XSLT processor.

The reason you were having difficulty is that you need to write a
namespace node to the result tree, not an attribute node.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Adrian Grigore
> Sent: 15 July 2003 22:00
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Newbie Namespace Problem in Meta-XSL
> 
> 
> Hi,
> 
> I'm doing some xsl metaprogramming and need to use xsl in 
> order to output 
> an xsl-stylesheet with the msxml-namespace. In other words, I 
> am trying to 
> output something like this with xsl:
> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="1.0" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
> 
> The problem is that I don't know how to output the 
> xmlns:msxsl attribute. 
> I've tried this:
> 
> <xsl:element name="xsl:stylesheet">
>                          <xsl:attribute 
> name="xmlns:msxsl" >urn:schemas-microsoft-com:xslt</xsl:attribute>
>                          <xsl:attribute 
> name="version">1.0</xsl:attribute>
>          ...
> 
> but it fails with the error message "The value of the 'name' 
> attribute may 
> not be 'xmlns:msxsl'". As the : is the culprit, I tried 
> replacing it with 
> &#58;, but that did not work either. I tried messing with 
> namespaces in the 
> meta-stylesheet, but without any success so far. I'm sure the 
> solution is 
> very simple, but I just don't get it... Please help! :-)
> 
> Thanks,
> 
> 
> Adrian Grigore
> 
> --
> Adrian Grigore
> adrian@xxxxxxxxxxxxxxx
> Lobstersoft - Fun Brain-Bending Games For All Ages 
http://www.lobstersoft.com Member of the Association of Shareware
Professionals


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


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



Current Thread
Keywords