xsl-list
[Top] [All Lists]

Re: namespace generation in the output.

2005-06-01 08:40:29
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






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>