Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] namespace generation in the output.

From: Dave Pawson <davep@------------->
To:
Date: 6/1/2005 3:41:00 PM
On Tue, 2005-05-31 at 20:56 +0100, David Carlisle wrote:
> Dave, in your case the namespace seems to be statically known in the
> stylesheet so usually you don't need to do this copying trick, which is
> only normally needed if you need to generate the namespace uri
> dynamically. 
I may be wrong, but I think I do.
I'm generating a stylesheet, whose default output elements
need to be in the (as you say, fixed) namespace.


> 
> I can't really tell as the snippet you posted isn't well formed, 
Sorry.
http://cvs.sourceforge.net/viewcvs.py/docbook/xsl/xhtml/html2xhtml.xsl?
view=markup
look for the xsl:template match="xsl:stylesheet"

> but for
> example if you know what element xsl:copy is copying as you know which
> element is being matched, then you can simply replace xsl:copy with a
> literal result element that has the needed namespace decln.
> 
> When you do need to dynamically generate a namespace declaration xslt2
> has an xsl:namespace instruction that works like xsl:attribute, but for
> namespaces.

Thanks David.
(Please note folks, MK is being 'hard teacher' - go find out, DC is
being 'nice teacher' this is it :-)


I want:

<xsl:stylesheet ..... (standard stuff)
   xmlns="http://example.com">

so I can write, in xslt 2.0,

<xsl:template match="....">
<xsl:element name="xsl:stylesheet" xsl:namespace="http://example.com">

(No, I haven't tried it. docbook isn't xslt 2.0 friendly... yet)


regards DaveP


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent