Re: [xslt] Bug(?) in xmlns handling

On Thu, Nov 16, 2006 at 12:31:56PM -0500, Jonathan S. Shapiro wrote:
> This may well be an error in our usage, so I hesitate to post a bug
> report without confirming. There has been a change in behavior beginning
> with the fedora libxslt-1.1.18-1 package, but it is likely that our
> input has always been wrong and it is simply getting "caught" now (which
> is good).
> Problem: We have an XSLT transformer that used to work (but may have
> been incorrect). It is emitting an SVG tree using the XML output method,
> and it is trying to wrap part of the output in a namespace tag by doing:
>      <xsl:element name="svg">
>        ...
> ==>     <xsl:attribute name="xmlns:svg">
>          <xsl:text></xsl:text>
>        </xsl:attribute>
> Beginning with 1.1.18-1, we get an error at the line indicated by the
> "==>".
>   compilation error: file ../../../../doc/doctools/XSLT/sbox-svg.xsl
>     line 47 element attribute
>   xsl:attribute: The prefixed QName 'xmlns:svg' has no namespace binding
>     in scope in the stylesheet; this is an error, since the namespace
>     was not specified by the instruction itself.
> [lines broken for readability]
> I'm not clear if this is a bug in libxslt or if it is a but in our
> transform script.

 The latter I guess:

  "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."


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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