[Phpxd-commits] CVS: phpXD README,1.2,1.3 README_DE,1.1,1.2 phpXD.php,1.14,1.15
Status: Beta
Brought to you by:
growbal
From: Thomas D. <th...@us...> - 2001-07-12 22:55:59
|
Update of /cvsroot/phpxd/phpXD In directory usw-pr-cvs1:/tmp/cvs-serv23949 Modified Files: README README_DE phpXD.php Log Message: Index: README =================================================================== RCS file: /cvsroot/phpxd/phpXD/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** README 2001/06/25 21:40:00 1.2 --- README 2001/07/12 22:55:56 1.3 *************** *** 69,91 **** "=" could destroy the hierarchy of the tree. - Don't try to access the DOM through the attributes of the DOM - interfaces, because if you change for example the data of an - CharacterData node, the nodeValue of the correnspondent Node is not changed: - echo $sample->getData(); // e.g.: "hello" - $sample->data = "new"; - echo $sample->data; // "new" - echo $sample->nodeValue; // "hello"; - - Instead of this, use the defined functions to access the DOM, e.g.: - $root->setData("new"); - - If you want only to read the attributes, it is allowed, because of this: - echo $dom->getDocType()->getPublicId(); // doesn't work - - $doctype = $dom->getDocType(); // bad style - echo $doctype->getPublicId(); - - echo $dom->doctype->publicId; // better - For more informations about the DOM interfaces see: http://www.w3.org/DOM/ --- 69,72 ---- Index: README_DE =================================================================== RCS file: /cvsroot/phpxd/phpXD/README_DE,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** README_DE 2001/06/25 21:39:13 1.1 --- README_DE 2001/07/12 22:55:56 1.2 *************** *** 75,102 **** einziges "=" die gesamte Hierachie des DOM zerstören. - Der Zugriff auf das DOM sollte nicht durch die Eigenschaften - (Attribute) der DOM Klassen zugegriffen werden, da diese unter - Umständen zusammenhängen, zum Beispiel wenn man die data Eigenschaft eines - CharacterData Elements ändert, wird nicht die nodeValue der - zugehörigen Node geändert: - echo $sample->getData(); // e.g.: "hello" - $sample->data = "new"; - echo $sample->data; // "new" - echo $sample->nodeValue; // "hello"; - - Stattdessen sollte man die Funktionen des DOM zum Verändern der - Eigenschaften benutzen, also: - $root->setData("new"); - - Will man nur lesend auf die Eigenschaften zugreifen, so ist der - direkte Zugriff unter Umständen schöner, da in PHP folgendes nicht - funktioniert: - echo $dom->getDocType()->getPublicId(); // geht nicht - - $doctype = $dom->getDocType(); // unschön - echo $doctype->getPublicId(); - - echo $dom->doctype->publicId; // so ist gut - Mehr Infos über das DOM und seine Klassen und Funktionen: http://www.w3.org/DOM/ --- 75,78 ---- Index: phpXD.php =================================================================== RCS file: /cvsroot/phpxd/phpXD/phpXD.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** phpXD.php 2001/07/11 21:35:25 1.14 --- phpXD.php 2001/07/12 22:55:56 1.15 *************** *** 22,25 **** --- 22,26 ---- */ + require("include/node.php"); require("include/attr.php"); require("include/characterdata.php"); *************** *** 34,38 **** require("include/entityreference.php"); require("include/namednodemap.php"); - require("include/node.php"); require("include/nodelist.php"); require("include/processinginstruction.php"); --- 35,38 ---- *************** *** 134,139 **** { $this->document = new Document(); - $this->document->nodeName = "#document"; - $this->document->nodeType = DOCUMENT_NODE; $parser = xml_parser_create(); --- 134,137 ---- |