You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lisa van Gelder <li...@wirestation.co.uk> on 2000/09/27 10:18:23 UTC

attribute problem

Hi guys

I've got a stylesheet that generates a stylesheet, and I want to generate
the stylesheet declaration at the top. I'm trying:

<xsl:template match="/">
<xsl:element name="xsl:stylesheet">
<xsl:attribute name="version">1.0</xsl:attribute>
<xsl:attribute
name="xmlns:xsl">http://www.w3.org/1999/XSL/Transform</xsl:attribute>

However the last attribute doesn't get generated at all, unless I take out
the colon on the "xmlns:xsl" bit. Are colons not allowed in attribute names?
How do I get around it, so that I can generate my attribute?

thanks in advance

Lisa


Re: attribute problem

Posted by Alexander Weinmann <aw...@bct-technology.com>.
If I remember well, it is not allowed to specify the xmlns:xsl attribute
in the result tree the way you did. (The specification forbids it)

Use <xsl:namespace-alias /> to get the result that you want. Read
section 7.1 one of the spec. I have already posted an example for
that some weeks ago.


Lisa van Gelder wrote:
> 
> Hi guys
> 
> I've got a stylesheet that generates a stylesheet, and I want to generate
> the stylesheet declaration at the top. I'm trying:
> 
> <xsl:template match="/">
> <xsl:element name="xsl:stylesheet">
> <xsl:attribute name="version">1.0</xsl:attribute>
> <xsl:attribute
> name="xmlns:xsl">http://www.w3.org/1999/XSL/Transform</xsl:attribute>
> 
> However the last attribute doesn't get generated at all, unless I take out
> the colon on the "xmlns:xsl" bit. Are colons not allowed in attribute names?
> How do I get around it, so that I can generate my attribute?
> 
> thanks in advance
> 
> Lisa
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

-- 
Alexander Weinmann | Web Developer
BCT Technology AG | D-77731 Willstätt/Germany | www.bct-technology.com