|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-12 16:41 UTC] rrichards@php.net
-Status: Open
+Status: Bogus
[2010-04-12 16:41 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
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>