previousXML_RDDL::getResourceById (Previous) (Next) XML_RDDL::getResourcesByPurposenext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

XML_RDDL::getResourcesByNature

XML_RDDL::getResourcesByNature() – selects all resources of a specified nature

Synopsis

require_once 'XML/RDDL.php';

array XML_RDDL::getResourcesByNature ( string $nature )

Description

Gets all resources of a given nature from an RDDL document. You have to call XML_RDDL::parseRDDL() first. The nature of a resource is specified by the 'xlink:role' attribute. A nature can be a stylesheet, a DTD, a HTML document, etc. You can find a list of well known natures at http://www.rddl.org/natures/.

Parameter

  • string $nature - nature of the resources you want to get.

Return value

array array containing all resources with the specified nature.

Note

This function can not be called statically.

Usage example

Getting all stylesheets from a document

<?php
require_once "XML/RDDL.php";
// create new 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 stylesheets
$xslt $rddl->getResourcesByNature('http://www.w3.org/1999/XSL/Transform');
echo 
"<pre>";
print_r($xslt);
echo 
"</pre>";
?>
previousXML_RDDL::getResourceById (Previous) (Next) XML_RDDL::getResourcesByPurposenext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.