Re: [xslt] Release candidate 1 of libxslt-1.1.27

  All the other patches are uncontroversial but that one need discussion

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.


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"

it will not result in a namespace declaration being output.

The test stylesheet in the regression does basically

<xsl:template match="doc">
<xsl:attribute name="xmlns:xsl"
<xsl:attribute name="attr">value</xsl:attribute>

> 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=""; 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 Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]