Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17165 программистов и 1833 робота. Сейчас ищет 1691 программист ...
Example
Вернуться к: XML_RDDL
Example
Example – Example for the usage of XML_RDDL
As the RDDL website contains RDDL resources embedded in the XHMTL code of the home page, it can be used in the following example.
Fetching resources from www.rddl.org
<?php
require_once "XML/RDDL.php";
// create new RDDL parser
$rddl = &new XML_RDDL();
// parse a document that contains RDDL resources
$result = $rddl->parseRDDL('http://www.rddl.org');
// check for error
if (PEAR::isError($result)) {
echo sprintf( "ERROR: %s (code %d)", $result->getMessage(), $result->getCode());
exit;
}
// get all resources
$resources = $rddl->getAllResources();
echo "<pre>";
print_r($resources);
echo "</pre>";
// get one resource by its Id
$test = $rddl->getResourceById('CSS');
echo "<pre>";
print_r($test);
echo "</pre>";
// get all stylesheets
$test = $rddl->getResourcesByNature('http://www.w3.org/1999/XSL/Transform');
echo "<pre>";
print_r($test);
echo "</pre>";
// get all normative references
$test = $rddl->getResourcesByPurpose('http://www.rddl.org/purposes#normative-reference');
echo "<pre>";
print_r($test);
echo "</pre>";
?>
Вернуться к: XML_RDDL