Revision [1214]

Last edited on 2011-10-28 08:53:23 by FsseInfo
Additions:
Once you've got an XML Reader node you can convert it into a DOM Document node by using expand, importNode and appendChild
Deletions:
Once you've got an XML node you can copy or load it into a DOM Document using expand, importNode and appendChild


Revision [1213]

Edited on 2011-10-28 08:52:17 by FsseInfo
Additions:
$rnode = $reader->expand();
$dnode = $dom->importNode($rnode,true); // recursively = true
$dom->appendChild($dnode); // append childnode to DOM Document root node
Deletions:
$node1 = $reader->expand();
$node2 = $dom->importNode($node1,true); // recursively = true
$dom->appendChild($node2); // append childnode to DOM Document root node


Revision [1212]

Edited on 2011-10-28 08:50:49 by FsseInfo
Additions:
====Copy XMLReader node into a DOMDocument====
Once you've got an XML node you can copy or load it into a DOM Document using expand, importNode and appendChild
$node1 = $reader->expand();
$dom = new DOMDocument();
$node2 = $dom->importNode($node1,true); // recursively = true
$dom->appendChild($node2); // append childnode to DOM Document root node


Revision [1211]

Edited on 2011-10-28 08:43:16 by FsseInfo
Additions:
http://ibm.com/developerworks/xml/library/x-xmlphp1/index.html
http://ibm.com/developerworks/xml/library/x-xmlphp2/index.html
http://ibm.com/developerworks/xml/library/x-xmlphp3/index.html
>>======PHP XML Reader======
====XMLReader Open====
You can either open an XML file with %%XMLReader::open($xmlfile)%% or set the xml directly with %%XMLReader::xml($xml)%%
====XMLReader Example====
%%(php)
$xmlread = new XMLReader();
$xmlread->xml($xmlresp);
$xmlread->read(); // read /Root
$xmlread->read(); // read first element /Element
while (true) { // loop through all elements at this level
echo $xmlread->name.' '.$xmlread->nodeType.PHP_EOL;
if (!$xmlread->next()) break;
}
exit;
Deletions:
>>===PHP XML Reader===
bool XMLReader::open ( string $URI [, string $encoding [, int $options= 0 ]] )


Revision [807]

Edited on 2009-05-20 04:54:47 by FsseInfo
Additions:
>>http://uk.php.net/manual/en/book.xmlreader.php
>>===PHP XML Reader===
%%
bool XMLReader::open ( string $URI [, string $encoding [, int $options= 0 ]] )
%%
Deletions:
>>http://uk.php.net/manual/en/refs.xml.php
>>===PHP XML===
There are a number of different ways to you can use PHP to manipulate XML.

==PHP & XML==
SimpleXml
XmlWriter


Revision [805]

The oldest known version of this page was created on 2009-05-20 04:52:40 by FsseInfo
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki