#49820 [Com]: XSLTProcessor returns Error at xsl:variable with comment inside
ID: 49820
Comment by: felixsigl at gmail dot com
Reported By: felixsigl at gmail dot com
Status: Open
Bug Type: XSLT related
Operating System: Windows
PHP Version: 5.3.0
New Comment:
Hi,
i have tried:
<xsl:variable select="1"
name="var"><!--comment--></xsl:variable>
thus no whitspace
but the same error: XSLT-variable: The must be no child nodes, since
the attribute 'select' was specified.
Previous Comments:
------------------------------------------------------------------------
[2009-10-10 11:54:46] Sjoerd@php.net
Thank you for your bug report.
Can you also reproduce it if you remove the whitespace between the
variable tags? In your example, the variable element would have a text
child node with some whitespace in it. Technically, this is not allowed
since the variable tag should have no content at all.
------------------------------------------------------------------------
[2009-10-09 13:03:40] felixsigl at gmail dot com
Description:
------------
I have a lot of XSL files which i want to process with the libxml
XSLTProcessor. But the XSLTProcessor returns Error at xsl:variable with
a comment inside. I don´t know exactly if this is a bug but i think so.
I know that i should use either a select attribute or child nodes in
the variable to define the variable. but shouldn´t comments be ignored
in that way?
Reproduce code:
---------------
the variable in the xsl file:
doesnt work!:
<xsl:variable select="1" name="var" >
<!-- comment -->
</xsl:variable>
works:
<xsl:variable select="1" name="var" />
works too:
<xsl:variable name="var" >
<!-- comment -->
</xsl:variable>
Expected result:
----------------
transformed XML
Actual result:
--------------
Error 1: compilation error: file file:///C:/Programme/xampp/test01.xsl
line 4 element variable Line: 0 Column: 0 Error 1: XSLT-variable: The
must be no child nodes, since the attribute 'select' was specified.
Line: 0 Column: 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49820&edit=1
Thread (8 messages)