This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: a very unusual namespace question
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] a very unusual namespace question
- From: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Date: Fri, 18 May 2001 13:23:32 +0200 (MET DST)
- Reply-To: xsl-list at lists dot mulberrytech dot com
> In most processors you will then be able to use the $ns-prefix to
> indicate the namespace that you're after. The only problem is that
> processors don't *have* to use the prefix you've specified when you
> create the attribute:
>
> "XSLT processors may make use of the prefix of the QName specified
> in the name attribute when selecting the prefix used for outputting
> the created attribute as XML; however, they are not required to do
> so and, if the prefix is xmlns, they must not do so."
>
> so it's not guaranteed (although I don't know of a processor that
> doesn't).
Some kind of conformance test maybe?
XML:
<el xmlns:prefix="uri1" prefix:att="foo" />
XSLT:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="el">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:attribute name="prefix:att2"
namespace="uri2">bar</xsl:attribute>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Expected output?
XT and Saxon choose a different prefix (fine),
Xalan 2.0.1 ignores my namespace declaration to be "uri2" (wrong).
Cheers,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@informatik.hu-berlin.de |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list