php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32209 Missing ? in processing instruction
Submitted: 2005-03-06 22:35 UTC Modified: 2005-03-07 08:10 UTC
From: md2perpe at gmail dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5CVS-2005-03-06 OS: *
Private report: No CVE-ID: None
 [2005-03-06 22:35 UTC] md2perpe at gmail dot com
Description:
------------
According to http://www.w3.org/TR/REC-xml/#sec-pi a processing instruction should begin with <?something and end with ?>. But DOMDocument::createProcessingInstruction doesn't output the questionmark at the end.


Reproduce code:
---------------
<?php
$doc = new DOMDocument();
$pi = $doc->createProcessingInstruction('name', 'content');
$doc->appendChild($pi);
echo $doc->saveHTML();
?>


Expected result:
----------------
<?name content?>


Actual result:
--------------
<?name content>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 02:01 UTC] Jared dot Williams1 at ntlworld dot com
saveHTML is correctly using SGML processing instruction close. HTML isnt XML.

Use saveXML for XML/XHTML.
 [2005-03-07 08:10 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC