Commit ffd52b9a authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 37a55320
......@@ -254,7 +254,13 @@ class tx_nG6_eid {
$doc = new DomDocument();
$data_root = $doc->createElement('data');
$data_root = $doc->appendChild($data_root);
$doc->appendChild($data_root);
$attr_data_root = $doc->createAttribute("xml:id");
$data_root->appendChild($attr_data_root);
$t_data_root = $doc->createTextNode('data_root');
$attr_data_root->appendChild($t_data_root);
$data_root->setIdAttribute("xml:id", true);
$magnitude = $doc->createElement('magnitude');
$magnitude->setAttribute("attribute", "g");
......@@ -285,6 +291,15 @@ class tx_nG6_eid {
$datasetst = $doc->createTextNode('');
$datasetst = $datasets->appendChild($datasetst);
$id = $doc->getElementById("data_root");
$toto = $doc->createElement('toto');
$id->appendChild($toto);
$xml_string = $doc->saveXML();
fwrite($fh, $xml_string);
fclose($fh);
foreach (range(0, $max) as $i) {
$file_path = trim(t3lib_div::_GP('file_path_'.(string)$i));
$file_path = $data_folder."/".$file_path;
......@@ -304,20 +319,20 @@ class tx_nG6_eid {
if (count($doc->getElementById($id_searched)) == 0) {
$parentl = implode("_", array_slice(explode(".", $mparts[1]), 0, -1));
// If no parent yet, this is the root
/*if (count($doc->getElementById(str_replace(".", "_", "node_".$parentl))) == 0) {
/*if (count($doc->getElementById($parentl)) == 0) {
$current_node = $doc->createElement('node');
$current_node->setAttribute("id", "node_"+str_replace("\.", "_", $mparts[1]));
$current_node->setAttribute("id", "node_"+str_replace(".", "_", $mparts[1]));
$current_node->setAttribute("name", $mparts[2]);
$current_node->setAttribute("g", $mparts[4]);
$current_node = $dom->getElementById("data_root").appendChild($current_node);
$current_node = $doc->getElementById("data_root").appendChild($current_node);
$current_nodet = $doc->createTextNode('');
$current_nodet = $current_node->appendChild($current_nodet);
} else {
$current_node = $doc->createElement('node');
$current_node->setAttribute("id", "node_"+str_replace("\.", "_", $mparts[1]));
$current_node->setAttribute("id", "node_"+str_replace(".", "_", $mparts[1]));
$current_node->setAttribute("name", $mparts[2]);
$current_node->setAttribute("g", $mparts[4]);
$current_node = $dom->getElementById("node_"+$parentl).appendChild($current_node);
$current_node = $doc->getElementById("node_"+$parentl).appendChild($current_node);
$current_nodet = $doc->createTextNode('');
$current_nodet = $current_node->appendChild($current_nodet);
}*/
......@@ -328,9 +343,7 @@ class tx_nG6_eid {
}
}
$xml_string = $doc->saveXML();
fwrite($fh, $xml_string);
fclose($fh);
$val = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment