Skip to content
Permalink
Browse files

Clean teiparser.php

  • Loading branch information...
lnprieto committed Jan 17, 2019
1 parent 06c2689 commit de88151b6c89ba8a68931228869e35913b35bca4
Showing with 4 additions and 13 deletions.
  1. +4 −13 lodel/scripts/teiparser.php
@@ -905,26 +905,17 @@ private function _parseBlocks(SimpleXMLElement $simplexml)
{
foreach($block->list[0]->item as $k => $v)
$this->_contents['entries'][$idtype][] = (string) $v;
} elseif (isset($block->term[0])) {
//$namespaces = $block->getDocNamespaces();
} elseif (isset($block->term[0])) {
foreach($block->term as $term) {
//$block->registerXPathNamespace('tei', $namespaces['']);
// traitement de ark=@ref
$ark = (string) $term->attributes()['ref'];
$mlnoms = array(); //'';
$mlnoms_str = '';
$mlnoms = array();
foreach ($term->term as $ssterm => $v) {
$lang=$v->attributes("http://www.w3.org/XML/1998/namespace")['lang']->__toString();
$mlnoms[$lang] = $v->__toString();
$mlnoms_str .= '<r2r:ml lang="'.$lang.'">'.$v->__toString().'</r2r:ml>';
}
$data = array ('g_name' => $ark, 'sortkey' => $mlnoms, 'data' => array('ark' => $ark, 'mlnom' => $mlnoms));
}
$data = array ('g_name' => $ark, 'data' => array('ark' => $ark, 'mlnom' => $mlnoms));
$this->_contents['entries'][$idtype][] = $data;
}
//print_r($term->xpath('//tei:term/tei:term'));
//print_r($term->xpath("//term")); // ./@ref donne bien l'ark du term courant
}
else
{

0 comments on commit de88151

Please sign in to comment.
You can’t perform that action at this time.