Detailed description and usage:
See the rddldump.php example for a good description about how to use this class.
An example:
include_once("class_rddl.php");
$rddl=new RDDL_parser();
$rddl->rddl_parse("http://www.rddl.org/");
$resources=$rddl->get_resources();
Documentation
Classes
RDDL_parser
Extends: None
Description: This class can be used to parse a RDDL document from a file or a URL and then it can be asked to return an array containing information about all the RDDL resources found on the file. The information can be used as you want.
Method Summary |
string |
get_error()
Returns the error message if there was a problem parsing the RDDL document |
Boolean |
rddl_parse(string $rddl)
Parses an RDDL document |
Array |
get_resources(string $rddl)
Returns resources found after parsing an RDDL document |
get_error
string get_error()
- This method returns an error message when rddl_parse returns false.
-
- Parameters:
-
- Returns:
- The last error message.
- Throws:
None
rddl_parse
Boolean rddl_parse(string $rddl)
- This method is called to parse an RDDL document from a URI or file.
-
- Parameters:
-
$rddl - URL or filename of the RDDL document to be parsed
- Returns:
- True if the document was parsed succesfully, false if there was an error.
- Throws:
None
get_resources
Array get_resources(string $rddl)
- This method returns an array containing the RDDL resources found in the parsed RDDL document.
-
- Parameters:
-
- Returns:
- An array of asociative arrays, each member of the array is a resource found in the RDDL document. Each member is an asociative array describing the resource, typical keys are: role, href, arcrole, type, title, id
- Throws:
None
|