Ciao a tutti ragazzi,
non riesco a impaginare il risultato della query applicata con XPath dentro il php.
Sapete dirmi come posso fare..vi giuro che le ho provate tutte!!!!
Pensate che l'output viene visualizzato così:
Invece lo voglio così, perchè voglio costruirci una tabella sopra:Graph Drawing Algorithm Engineering Research Group http://www.dia.uniroma3.it/research/ACG.html http://www.web.dia.uniroma3.it/ http://www.uniroma3.it 1 netkit
Graph Drawing
Algorithm Engineering Research Group
http://www.dia.uniroma3.it/research/ACG.html
http://www.web.dia.uniroma3.it/
http://www.uniroma3.it
1
netkitSapete darmi consigli? grazie anticipatamenteCodice PHP:
<?php
$real_path = realpath("./files/database/database.xml");
if(!$domdb = domxml_open_file($real_path)){
die("Error while parsing the document");
}
else {
echo "<CENTER><H3>Xpath Test execute.</H3></CENTER>";
}
$xpath = $domdb->xpath_new_context();
xpath_register_ns($xpath, 'my',"http://www.dia.uniroma3.it/~volpi/files/database");
?>
<?php
$query = "/my:WebSite/my:ResearchGroup[child::my:NameGroup='Graph Drawing']";
$xpath_nodeset = $xpath->xpath_eval($query);
$names = array();
foreach ($xpath_nodeset->nodeset as $iterator) {
$names[] = $iterator->get_content();
}
foreach($names as $i){
echo $i;
echo "
";
}
?>
Saluti Simone