Re: xsl:comment problem
Thomas Comiotto <[email protected]> Sat, 10 Mar 2007 09:00:21 +0100
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Message-ID | <[email protected]> |
On Mar 9, 2007, at 10:09 AM, Peter Van der Beken wrote:
> Thomas Comiotto wrote:
>> <style type="text/css">
>> <xsl:comment>
>> @import url("<xsl:value-of select="$aVariable"/>/foo/bar.css");
>> </xsl:comment>
>> </style>
>> does output:
>> <style type="text/css">
>> <!--
>> @import url("/foo/bar.css");
>> -->
>> </style>
>
> Without seeing aVariable it's impossible to know if this is a bug.
>
>> <xsl:comment>
>> <foo>bar</foo>
>> </xsl:comment>
>> <!--
>> bar
>> -->
>
> http://www.w3.org/TR/xslt#section-Creating-Comments:
> "It is an error if instantiating the content of xsl:comment creates
> nodes other than text nodes. An XSLT processor may signal the
> error; if it does not signal the error, it must recover by ignoring
> the offending nodes together with their content."
>
Ok let's get this one straight; in the above example $aVariable
resolves to some #text, so the given example is perfectly compliant
with the spec. The xslt processor's not. It does not substitute
variables when being descendants of xsl:comment directives, whether
those variables reference #text or not.
I think I'll file a bug.
Thanks,
Thomas