php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29978 Using acute in DomElements
Submitted: 2004-09-04 13:33 UTC Modified: 2004-09-05 15:32 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: guillaume dot forget at espci dot fr Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: Irrelevant OS: NetBSD
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: guillaume dot forget at espci dot fr
New email:
PHP Version: OS:

 

 [2004-09-04 13:33 UTC] guillaume dot forget at espci dot fr
Description:
------------
Hi!

I'm using domxml function for modifying xml files.
But when I put acute (?,?,?,?,?,...), and try a DomElement->set_attribute(...), the resulting dom object is truncated at the acute place.

I do not think the problem come from the DomObj->dump_mem() or DomObj->dump_file(...) functions because both gave the same result.
If I remove the acutes, it works fine.

Reproduce code:
---------------
$xmlfile="test.xml";
$text="c'est l'?t? !";
$domobj = domxml_open_file ($xmlfile);
$node = $domobj->last_child();
$test_node = $domobj->create_element("balise2");
$balise = $node->append_child($poly_node);
$balise->set_attribute (test,$text);
echo $domobj->dump_mem();

XML file (test.xml):
<?xml version="1.0" encoding="ISO-8859-1"?>
<balise1 />



Expected result:
----------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<balise1><balise2 test="c'est l'?t? !"/></balise1>


Actual result:
--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<balise1>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-04 13:37 UTC] guillaume dot forget at espci dot fr
In the code, you have to read 
$balise = $node->append_child($test_node);

instead of:
$balise = $node->append_child($poly_node);
 [2004-09-04 19:01 UTC] chregu@php.net
DOMXML expects UTF-8 encoded input for set_attribute (and all other functions except loading a whole XML document, where the XML header is recognized)
 [2004-09-05 15:29 UTC] guillaume dot forget at espci dot fr
Ok thanks, it's work well now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC