PHP5 (domxml)
XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE webdoctype SYSTEM "webdoc.dtd">
<webdoc>
 <article id="651" oth="mauro"/>
</webdoc>
article.id=651
article.oth=mauro

SOURCE:
<html>
<body>
   <?php print "PHP5 (domxml)"?><br>
   <?php
      $xmlstr 
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".
      
"<!DOCTYPE webdoctype SYSTEM \"webdoc.dtd\">\n".
      
"<webdoc>\n".
      
" <article id=\"651\" oth=\"mauro\"/>\n".
      
"</webdoc>\n";

      
$dom = new DomDocument;
      
$dom->loadXML($xmlstr);
      
# $node = $dom->root(); 
      
$node $dom->getElementsByTagName("article")->item(0);
      
$attr $node->attributes;
      
printf("XML:<pre>\n%s</pre>\n",htmlspecialchars($xmlstr));
      
printf("article.%s=%s<br>"$attr->item(0)->name$attr->item(0)->value);
      
printf("article.%s=%s<br>"$attr->item(1)->name$attr->item(1)->value);
   
?>
<hr>
<b>SOURCE:</b><br>
<? show_source("test-domxml.php"); ?>
</body>
</html>
<br><br><a href="/golem/">&lt; &lt; back</a>


< < back