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

Re: [xsl] xsl transforming xsl


Subject: Re: [xsl] xsl transforming xsl
From: Trevor Nash <tcn@xxxxxxxxxxxxx>
Date: Thu, 19 Sep 2002 19:35:24 +0100

>I cannot output an arbitratry namespace for the xsl template which is 
>generated and use namespace alias for mainly cosmetic reasons, but I think 
>management will not bend on this.
>
That is unfortunate, because it is the right way to do it.  I suggest
you send them on an XML course to teach them that such things are not
a problem :-)

>Does anyone have an idea of what might work in this situation?  Is there a 
>way to switch the namespace prefix as well as the definition of that 
>namespace?
>
In fact, there is currently no rule that says the XSLT processor (or
any other kind of XML processor for that matter) has to honour the
prefix you use.  It just has to make sure the namespace is correct.

I believe XSLT 2.0 changes this, because there is a bit of a problem
in that namespace prefixes can also apear inside attribute values - as
they do in XPath used within XSLT.

Until then, the best you can do is use the namespace-alias mechanism,
but in your stylesheet use 'xsl' for the dummy namespace (which is to
be aliased) and something else for the XSLT namespace.  The XSLT
processor will probably then write the generated stylesheet as
required.  Of course your stylesheet will then be using a 'non
standard' namespace prefix itself.  If that is not acceptable you are
stuck with using 'sed' or something to post-process the output.

Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

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



Current Thread
Keywords