ID: 14850
Updated by: mfischer
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: DOM XML related
Operating System: FreeBSD 4.5-PRERELEASE
PHP Version: 4.1.1
New Comment:

About Example 2:
Entity references defined in the document are their own nodes. You
should carefully look at print_r($node);

Next please don't open one report about two things (even if they look
the same).

Previous Comments:
------------------------------------------------------------------------

[2002-01-04 10:09:37] [EMAIL PROTECTED]

There are two instances where I am having problems with entities.
test.php and test.xml below exhibit a problem with xml entities.

The output is:
Blah Blah ® Blah Blah

The expected output was:
Blah Blah ® Blah Blah

The second problem exhibited by test2.php and test2.xml has to do with
DTD entities.

The output is:
Blah Blah 

The expected output was:
Blah Blah ® Blah Blah

The setup is PHP 4.1.1 with a patch to php_domxml.c from 1.67.2.9 to
1.90 that fixes a problem with PHP crashing with DTD entities.

test.php:
--
<?
$xml = "test.xml";
$doc = xmldocfile($xml);
$context = $doc->xpath_new_context();
$query = "//test";
$nodes = $context->xpath_eval($query);
$node = $nodes->nodeset[0]->children();
$content .= $node[0]->content;
echo htmlentities($content);
?>

test.xml:
--
<?xml version="1.0"?>
<test>Blah Blah &#174; Blah Blah</test>

test2.php:
--
<?
$xml = "test2.xml";
$doc = xmldocfile($xml);
$context = $doc->xpath_new_context();
$query = "//test";
$nodes = $context->xpath_eval($query);
$node = $nodes->nodeset[0]->children();
$content .= $node[0]->content;
echo htmlentities($content);
?>

test2.xml:
--
<?xml version="1.0"?>
<!DOCTYPE test [
<!ENTITY reg "&#174;">
]>
<test>Blah Blah &reg; Blah Blah</test>

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=14850&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to