Re: [xslt] Attribute namespace bug

On Fri, Nov 22, 2002 at 07:56:59AM -0500, Norman Walsh wrote:
>   <xsl:element name="doc" namespace="ns1">
>     <xsl:attribute name="attr" namespace="ns1">
>       <xsl:text>foo!</xsl:text>
>     </xsl:attribute>
>   </xsl:element>
> produces
>   <doc xmlns="ns1" attr="foo!"/>
> where (I believe) it should produce
>   <x:doc xmlns:x="ns1" x:attr="foo!"/>
> or some other variation thereof. In any event, 'attr' needs an
> explicit namespace prefix.

  Right that was a bug.
And was relatively easy to solve:
paphio:~/XSLT/tests/general -> xsltproc bug-99.xsl ../docs/bug-99.xml
<?xml version="1.0"?>
<doc xmlns="ns1" xmlns:ns1="ns1" ns1:attr="foo!"/>
paphio:~/XSLT/tests/general -> cd ..
paphio:~/XSLT/tests ->

  However now I have possibly a very ugly output, I could also force

<xsl:element name="doc" namespace="ns1"> to be prefixed even if there is
no default namespace in scope at the insertion point. However I'm also
afraid that people may rely on it to generate an element and for it to be
in the default namespace (think html in the xhtml1 namespace)...

  How do other processors handle this test case ?


Daniel Veillard      | Red Hat Network  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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