Loading an XRD file

XRD .xml files may be loaded directly from a file, or from a string:

Loading an XRD file

<?php
try {
   
$xrd->loadFile('/path/to/the/file.xrd''xml');
} catch (
XML_XRD_Exception $e) {
   die(
'Loading XRD file failed: ' $e->getMessage() . "\n");
}
?>

Loading an XRD string

<?php
try {
   
$xrd->loadString($fullXrdXmlHere'xml');
} catch (
XML_XRD_Exception $e) {
   die(
'Loading XRD failed: ' $e->getMessage() . "\n");
}
?>

XML_XRD tries to autodetect if the file is XML or JSON (JRD) and use the correct loader. You can make its life easier (and skip autodetection, and reduce network load) by passing the type parameter:

Loading a JRD file

<?php
try {
   
$xrd->loadFile('/path/to/the/file.jrd''json');
} catch (
XML_XRD_Exception $e) {
   die(
'Loading JRD file failed: ' $e->getMessage() . "\n");
}
?>
How to use the package (Previous) Verification (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.