Esempio n. 1
0
}
showDoc('Values of: @identifier, metadata/schema, ... (see below)', $stuff);
function showHtml($path)
{
    global $testdoc;
    echo '<h4>Html-value of ', htmlspecialchars($path), '</h4><pre>', $testdoc->xmd_html_value($path), '</pre>';
}
showHtml('/*/organizations/organization/item[1]/title');
showHtml('organizations/organization/item/title');
showHtml('organizations/organization/item/title *');
showHtml('Titles:  -% organizations/organization/item/titl ,  %- .');
// if no elements are found, prefix and postfix are not generated
showHtml('Titles:  -% organizations/organization/item/title ,  %- .');
showHtml('<ul><li> -% resources/resource/file/../@identifier </li><li> %- </li></ul>');
showHtml('metadata/lom/general/description/langstring');
echo '<h5>The same, but in a HTML construct:</h5>', $testdoc->xmd_html_value('metadata/lom/general/description/langstring');
function getmicrotime()
{
    list($usec, $sec) = explode(" ", microtime());
    return (double) $usec + (double) $sec;
}
$xmlFile = 'imsmanifest_reload.xml';
$presXmlFileContents = @file_get_contents_n($xmlFile) or die('XML file  ' . htmlspecialchars($xmlFile) . ' is missing...');
$presXmlFileContents = explode("\n", $presXmlFileContents);
$seconds = getmicrotime();
$testdoc2 = new xmddoc($presXmlFileContents);
$seconds = getmicrotime() - $seconds;
showDoc('Time to parse', $seconds);
$seconds = getmicrotime();
$testdoc2->xmd_cache();
$seconds = getmicrotime() - $seconds;