From:             
Operating system: Fedora 12 GNU/Linux
PHP version:      5.3.2
Package:          DOM XML related
Bug Type:         Bug
Bug description:DOMDocument::createElement() does not handle <link> correctly

Description:
------------
DOMDocument::createElement() does not add a closing </link> tag with
DOMDocument::createElement('link'). It outputs <element> rather than
<element></element>.



I am using php-5.3.2-1.fc12.i686 and php-xml-5.3.2-1.fc12.i686 installed
using Yellowdog Updater, Modified Package Manager. All other DOM methods
tried so far work fine.

Test script:
---------------
<?php

$implementation = new DOMImplementation();

$document = $implementation->createDocument(null, null,
$implementation->createDocumentType('html'));

$html = $document->createElement('html');

$head = $document->createElement('head');

$stylesheet = $document->createElement('link');

$title = $document->createElement('title', 'Possible link error');

$body = $document->createElement('body');

$html->setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');

$stylesheet->setAttribute('href','style.css');

$stylesheet->setAttribute('rel','stylesheet');

$stylesheet->setAttribute('type','text/css');

$document->appendChild($html);

$html->appendChild($head);

$html->appendChild($body);

$head->appendChild($stylesheet);

$head->appendChild($title);

echo $document->saveHTML();

Expected result:
----------------
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml";>

<head>

<link href="style.css" rel="stylesheet" type="text/css"></link>

<title>Possible link error</title>

</head>

<body></body>

</html>

Actual result:
--------------
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml";>

<head>

<link href="style.css" rel="stylesheet" type="text/css">

<title>Possible link error</title>

</head>

<body></body>

</html>



-- 
Edit bug report at http://bugs.php.net/bug.php?id=51530&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51530&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51530&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51530&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51530&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51530&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51530&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51530&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51530&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51530&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51530&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51530&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51530&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51530&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51530&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51530&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51530&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51530&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51530&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51530&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51530&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51530&r=mysqlcfg

Reply via email to