Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - namespaces [Thread Next] Re: namespacesTo: NULL Date: 10/6/2005 5:37:00 PM
Dmitry Nogin wrote:
> How to output different namespaces?
> I mean something like this approach:
>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>
> <xsl:param name="ns"/>
> <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
>
> <xsl:template match="/">
> <out:stylesheet version="1.0" xmlns:iis="{$ns}">
> ^
> |
> Parameter substitution isn't applied here.
Why do you need that? If you want to create a certain element or
attribute you can do e.g.
<xsl:element name="iis:elementname" namespace="{$ns}">
<xsl:attribute name="iis:attributename"
namespace="{$ns}">value</xsl:attribute>
and when that is serialized the namespace attribute nodes e.g.
xmlns:iis="..."
are added automatically.
There is no need to add xmlns:prefix attributes by hand for result elements.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
