Re[2]: [xml] xmlNodeGetContent() bug?



Hello Daniel,

Thursday, June 12, 2003, 7:17:02 PM, you wrote:

DV> On Thu, Jun 12, 2003 at 06:32:48PM +0400, Alexander Grimalovsky wrote:
$root->append_child($xml->create_entity_reference('A'));

DV>   A is NOT an entity reference. It's a *character reference*. This
DV> has nothing in common, it's just a shorhand for a given Unicode code point.

 Ok, maybe. But putting here normal entity reference does nothing too.

<?php
$xml = xmldoc('<?xml version="1.0"?><!DOCTYPE root [<!ENTITY test "some text">]><root/>');
$root = $xml->root();
$root->append_child($xml->create_entity_reference('&lt;'));
$root->append_child($xml->create_text_node('text_1'));
$root->append_child($xml->create_entity_reference('&test;'));
$root->append_child($xml->create_text_node('text_2'));
$root->append_child($xml->create_entity_reference('&gt;'));
echo $xml->dump_node($root)."\n";
echo $root->get_content()."\n";
?>

 Gives me:
<root>&lt;text_1&test;text_2&gt;</root>
text_1text_2


DV> Daniel


-- 
Best regards,
 Alexander                            mailto:flying dom natm ru





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]