[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: namespace generation in the output.

Subject: Re: namespace generation in the output.
From: Dave Pawson <davep@xxxxxxxxxxxxx>
Date: Wed, 01 Jun 2005 16:40:29 +0100
xsl attribute namespace generation
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.