#27981 [Opn->Bgs]: xsl:copy-of
| From: | amt@php.net | Date: | Tue, 13 Apr 2004 17:35:22 +0000 |
| Subject: | #27981 [Opn->Bgs]: xsl:copy-of | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-58067@lists.php.net to get a copy of this message | ||
ID: 27981
Updated by: amt@php.net
Reported By: phpsurf at ifrance dot com
-Status: Open
+Status: Bogus
Bug Type: XSLT related
Operating System: Win2K
PHP Version: 5CVS-2004-04-13 (dev)
New Comment:
You're setting the stylesheet output method to "html".
In HTML, <link> is an empty element. You should do <xsl:
output method="xml" ... /> instead.
See 16.2 of http://www.w3.org/TR/xslt
Previous Comments:
------------------------------------------------------------------------
[2004-04-13 12:58:42] phpsurf at ifrance dot com
Description:
------------
The <xsl:copy-of> transformation on elements called '<link>'.
This is extremely anoying for transforming RSS for example.
Reproduce code:
---------------
Here is the xml file :
<rss version="0.92">
<channel>
<item>
<timestamp>1057489449</timestamp>
<title>aaa</title>
<link>bbb</link>
</item>
</channel>
</rss>
and the xslt file :
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"
encoding="utf-8"/>
<xsl:template match="/">
<xsl:copy-of select="*"/>
</xsl:template>
</xsl:stylesheet>
Expected result:
----------------
<rss version="0.92">
<channel>
<item>
<timestamp>1057489449</timestamp>
<title>aaa</title>
<link>bbb</link>
</item>
</channel>
</rss>
Actual result:
--------------
<rss version="0.92">
<channel>
<item>
<timestamp>1057489449</timestamp>
<title>aaa</title>
<link>
</item>
</channel>
</rss>
Look at the <link> element ! it doesn't close anymore.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27981&edit=1