Re: [xslt] Release candidate 1 of libxslt-1.1.27
- From: Daniel Veillard <veillard redhat com>
- To: Nick Wellnhofer <wellnhofer aevum de>
- Cc: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: Re: [xslt] Release candidate 1 of libxslt-1.1.27
- Date: Thu, 6 Sep 2012 21:10:55 +0800
All the other patches are uncontroversial but that one need discussion
IMHO
On Wed, Sep 05, 2012 at 07:20:14PM +0200, Nick Wellnhofer wrote:
> >From 578c5ffb17e9502dd0fe8f9df783a9f5cddb35da Mon Sep 17 00:00:00 2001
> From: Nick Wellnhofer <wellnhofer aevum de>
> Date: Thu, 16 Aug 2012 02:18:31 +0200
> Subject: [PATCH 5/5] Fix handling of names in xsl:attribute
>
> A prefix of 'xmlns' is actually allowed. It should simply be ignored
> if a namespace is given. Without a namespace the lookup by prefix will
> fail anyway.
it's true that the spec forbids a resulting name of "xmlns"
> What the spec doesn't allow is an attribute name of 'xmlns' which will
> now be rejected.
agreed,
But it also gives the example:
----------------------------------------------
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. Thus, although it is not an error
to do:
<xsl:attribute name="xmlns:xsl"
namespace="whatever">http://www.w3.org/1999/XSL/Transform</xsl:attribute>
it will not result in a namespace declaration being output.
-----------------------------------------------
The test stylesheet in the regression does basically
<xsl:template match="doc">
<doc>
<xsl:attribute name="xmlns:xsl"
namespace="whatever">http://www.w3.org/1999/XSL/Transform</xsl:attribute>
<xsl:attribute name="attr">value</xsl:attribute>
</doc>
</xsl:template>
> diff --git a/tests/REC/test-7.1.3.out b/tests/REC/test-7.1.3.out
> index dee0832..652fd9c 100644
> --- a/tests/REC/test-7.1.3.out
> +++ b/tests/REC/test-7.1.3.out
> @@ -1,2 +1,2 @@
> <?xml version="1.0"?>
> -<doc attr="value"/>
> +<doc xmlns:ns_1="whatever" ns_1:xsl="http://www.w3.org/1999/XSL/Transform" attr="value"/>
So basically, I was just dropping the attempt to output the attribute
(based on suggested error handling in the previous paragraph), but
you instead kept the attribute output but remapped the prefix to avoid
the error case.
This is probably closer to the specification as "xmlns:xsl" is not an
error from the previous paragraph description. Did you came with that
fix based on a bug report or divergence from what other processor did
or pure spec reading ?
I'm not against that last patch but i would like to understand where
this comes from :-) and I would probably add a bit of explanation in
the commit log as a result
Other patches are pushed (I just removed an unused variable the 4th
patch when commiting)
thanks a lot !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]