Exemplo n.º 1
0
    $count = $_REQUEST['count'];
}
if (!isset($_REQUEST['collection'])) {
    $collection = 'org';
} else {
    $collection = $_REQUEST['collection'];
}
/* Inicializa array contendo os parâmetros necessários ao serviço */
$param = array('count' => $count, 'collection' => $collection);
/* Consome o serviço */
$xml = $clientesoap->call('lastRecords', $param);
/* Parâmetro de DEBUG */
if ($_REQUEST['return'] == 'soap') {
    echo '<h2>Request</h2><pre>' . htmlspecialchars($clientesoap->request, ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2><pre>' . htmlspecialchars($clientesoap->response, ENT_QUOTES) . '</pre>';
    echo '<h2>Debug</h2><pre>' . htmlspecialchars($clientesoap->debug_str, ENT_QUOTES) . '</pre>';
} else {
    if (!validateXML($xml)) {
        include_once dirname(__FILE__) . "/conf/" . $widgetConf['error_file'];
    }
    /* Transformação XSLT */
    if (!($transformer = xslt_create())) {
        die('error opening sablotron');
    } else {
        $xsl = file_get_contents(dirname(_FILE_) . '/xsl/wg_listRecords.xsl');
        $arguments = array('/_xml' => $xml, '/_xsl' => $xsl);
        $procResult = xslt_process($transformer, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
        /* Imprime resultado */
        echo $procResult;
    }
}
Exemplo n.º 2
0
 echo 'Upload war erfolgreich.<br/>';
 if ($_SESSION['extension'] == 'csv') {
     //validateCSV has to be called with the minimal number of columns as second argument
     $valid = validateCSV('upload/files/' . $_SESSION['fileNameInternal'] . '.csv', 40);
     if ($valid == 1) {
         $data = loadCSV('upload/files/' . $_SESSION['fileNameInternal'] . '.' . $_SESSION['extension']);
         $serialize = serialize($data);
         file_put_contents('upload/files/dataPHP-' . $_SESSION['fileNameInternal'], $serialize);
         $_SESSION['store'] = 1;
         echo 'Import war erfolgreich.<br /><a href="annotate.php">Weiter zur Metadatenaufnahme</a>';
     } else {
         unlink('upload/files/' . $_SESSION['fileNameInternal'] . '.csv');
         die('Fehler beim Import: ' . $valid);
     }
 } elseif ($_SESSION['extension'] == 'xml') {
     $valid = validateXML('upload/files/' . $_SESSION['fileNameInternal'] . '.xml', 'uploadXML.xsd', 'mods-3-4.xsd');
     if ($valid == 1) {
         $data = loadXML('upload/files/' . $_SESSION['fileNameInternal'] . '.' . $_SESSION['extension']);
         $serialize = serialize($data);
         file_put_contents('upload/files/dataPHP-' . $_SESSION['fileNameInternal'], $serialize);
         $_SESSION['store'] = 1;
         echo 'Import war erfolgreich.<br /><a href="annotate.php">Weiter zur Metadatenaufnahme</a>';
     } elseif ($valid == 'mods') {
         //Deleting older files from folder "download"
         array_map('unlink', glob('download/*'));
         transformMODS($_SESSION['fileNameInternal']);
         if (file_exists('download/' . $_SESSION['fileNameInternal'] . '.xml')) {
             $data = loadXML('download/' . $_SESSION['fileNameInternal'] . '.xml');
             makeCSV($data, 'download', $_SESSION['fileNameInternal']);
             unlink('upload/files/' . $_SESSION['fileNameInternal'] . '.xml');
             echo 'Es wurde eine valide MODS-Datei erkannt und konvertiert.<br />Sie k&ouml;nnen mit <a href="download/' . $_SESSION['fileNameInternal'] . '.xml" target="_blank">dieser XML-Datei</a> oder <a href="download/' . $_SESSION['fileNameInternal'] . '.csv" target="_blank">dieser CSV-Datei</a> weiterarbeiten.';
Exemplo n.º 3
0
<?php

function validateXML($xmlFile)
{
    $dom = new DomDocument();
    $dom->load($xmlFile);
    if (@$dom->validate()) {
        echo $xmlFile . " valido<br/>";
    } else {
        echo $xmlFile . " no valido<br/>";
    }
}
validateXML("actions.xml");
validateXML("application.xml");
validateXML("datasources.xml");
validateXML("ldap.xml");