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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
13 - 1 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC