<html>
<body>
<?php
//error_reporting(15);
require ('xml.class.php');
Echo "PHP XML-LittleParser:<br>";
$pd = '
<news>
<author>GOsha</author>
<pubnum>300</pubnum>
<text>
<head> 123 </head>
<content> Text </content>
</text>
<ca attrib="123" attr2 = "12">TestCA</ca>
</news>
';
//This class can parse only straight-line XML, not parallel!!!
//See example.
//If we have 2 identical properties such as:
//<author id="1">GOsha</author>
//<author id="2">Mbisha</author>
//it will returns Mbisha in "author" nest and id=2 in properties.
$XC = new XMLParser;
$XC->xml_data = $pd;
//$XC->xml_attr_varname = "xml_attr";
//$XC->xml_data_varname = "xml_data";
//$XC->xml_encoding = "utf-8";
$p_result = $XC->Parse();
Echo "<pre>";
Echo print_r($p_result);
Echo "</pre>";
?>
</body>
</html>
|