php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38578 Can't create internal entities
Submitted: 2006-08-24 10:23 UTC Modified: 2006-08-24 11:40 UTC
From: dandrikop at cosmote dot gr Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.1.5 OS: Fedora Core 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dandrikop at cosmote dot gr
New email:
PHP Version: OS:

 

 [2006-08-24 10:23 UTC] dandrikop at cosmote dot gr
Description:
------------
Cannot create internal entity declarations with DOMImplementation object like the following:

<!DOCTYPE clickAPI SYSTEM "my.dtd" [
    <!ENTITY testme "HELLO">
]>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-24 10:25 UTC] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2006-08-24 11:05 UTC] dandrikop at cosmote dot gr
As the documentation says at "http://www.php.net/manual/en/function.dom-domimplementation-createdocumenttype.php" the following code:

======================================================
<?php

// Creates an instance of the DOMImplementation class
$imp = new DOMImplementation;

// Creates a DOMDocumentType instance
$dtd = $imp->createDocumentType('graph', '', 'graph.dtd');

// Creates a DOMDocument instance
$dom = $imp->createDocument("", "", $dtd);

// Set other properties
$dom->encoding = 'UTF-8';
$dom->standalone = false;

// Create an empty element
$element = $dom->createElement('graph');

// Append the element
$dom->appendChild($element);

// Retrieve and print the document
echo $dom->saveXML();
?> 
======================================================

produces:

======================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE graph SYSTEM "graph.dtd">
<graph/>
======================================================

So how can someone produce the following XML?

======================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE graph SYSTEM "graph.dtd"[
    <!ENTITY testme "HELLO">
]>
<graph/>
======================================================
 [2006-08-24 11:40 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Dec 04 02:01:23 2020 UTC