ID: 49820 Comment by: wellnhofer at aevum dot de Reported By: felixsigl at gmail dot com Status: Open Bug Type: XSLT related Operating System: Windows PHP Version: 5.3.0 New Comment:
I had a deeper look at the XSLT spec and it seems the both cases are bugs in libxslt. Previous Comments: ------------------------------------------------------------------------ [2010-02-09 23:50:22] wellnhofer at aevum dot de The second example without whitespace is a bug in libxslt. It's a pretty minor issue, but maybe I'll fix it in libxslt. Nick ------------------------------------------------------------------------ [2009-10-10 14:15:14] felixsigl at gmail dot com 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. ------------------------------------------------------------------------ [2009-10-10 11:54:46] sjo...@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