$secondary_title = ''; $abstract = ''; $authors = ''; $doi = ''; $year = ''; $volume = ''; $issue = ''; $pages = ''; $new_authors = array(); $array = array(); // TITLE $title_obj = $xpath->query("h3/a", $item)->item(0); if (is_object($title_obj)) { $title = trim($title_obj->nodeValue); } $item_html = DOMinnerHTML($item); $item_html = str_replace("\r\n", " ", $item_html); $item_html = str_replace("\n", " ", $item_html); $item_html = str_replace("\r", " ", $item_html); // IEEE ID preg_match('/(?<=arnumber\\=)\\d+?(?=\\&)/ui', $item_html, $id_match); if (isset($id_match[0])) { $id = trim(strip_tags($id_match[0])); $uid = 'IEEE:' . $id; } // AUTHORS $authors_arr = array(); preg_match_all('/\\<a href\\=\\"\\#\\" class\\=\\"(authorPreferredName)? prefNameLink\\".*?\\<\\/a\\>/ui', $item_html, $authors_match); foreach ($authors_match[0] as $author_raw) { $authors_arr[] = trim(strip_tags($author_raw)); }
$DOM = new DOMDocument(); $DOM->loadHTML($r); $items = $DOM->getElementsByTagName('div'); $rev = array(); foreach ($items as $item) { if ($item->getAttribute("class") == "rev_title") { $rev['title'] = $item->nodeValue; } if ($item->getAttribute("class") == "rev_author") { $rev['author'] = $item->nodeValue; } if ($item->getAttribute("class") == "rev_rating") { $rev['rating'] = $item->nodeValue; } if ($item->getAttribute("class") == "rev_content") { $rev['content'] = DOMinnerHTML($item); } } if (count($rev) > 0) { ?> <div class="customer_review"> <span title="<?php echo $rev['rating']; ?> out of 5 stars" class="zah_rating zah_rating_<?php echo zah_rate($rev['rating']); ?> " itemprop="rating"><?php echo $rev['rating']; ?> </span>
} else { if ($td_contents) { array_push($track['meta'], $td_contents); } } } } } $track['links'] = array(); for ($z = 0; $z < count($trackformats); $z++) { if ($trackformats[$z] != "f" && $trackformats[$z] != "FlashPlayer" && $trackformats[$z] != "Flash" && $trackformats[$z] != "Flash Player" && $trackformats[$z] != "WebPlayer") { $d = new DOMDocument(); $d->loadHTML($tracklinks[$z]); $links = $d->getElementsByTagName('a'); foreach ($links as $l) { $text = DOMinnerHTML($l); $link = $l->getAttribute('href'); if ($text != "f" && $text != "FlashPlayer" && $text != "Flash" && $text != "Flash Player" && $text != "WebPlayer") { array_push($track['links'], array('text' => $text, 'url' => $link, 'type' => $trackformats[$z])); } } } } if (array_key_exists('title', $track) && $track['title'] && count($track['links']) > 0) { $imgname = getStationImage($track['title']); print '<div class="radiostation">'; print '<div class="containerbox indent padright menuitem">'; if ($imgname === null) { // print '<i class="icon-radio-tower fixed smallcover-svg"></i>'; print '<div class="smallcover fixed"><img class="smallcover" src="newimages/broadcast.svg" /></div>'; } else {
// $file: strip-html.php $timestamp: 2011/09/28 @ 21:03 $xmlString = "<root><note><texte>Note <strong>1</strong></texte></note><note><texte>Note <strong>2</strong></texte></note></root>"; // $dom = new DOMDocument; // $fragment = $dom->createDocumentFragment(); // $fragment->appendXML($xmlString); // $dom->appendChild($fragment); // echo $dom->saveXML($dom->documentElement); $xml = new DOMDocument(); $xml->loadXML($xmlString); $root = $xml->documentElement; foreach ($root->getElementsByTagName('note') as $note) { foreach ($note->childNodes as $child) { if ($child->tagName == 'texte') { // echo $child->firstChild->nodeValue . "\n"; echo DOMinnerHTML($child); } } } // echo $xml->saveXML($xml->documentElement); function DOMinnerHTML($element) { $innerHTML = ""; $children = $element->childNodes; foreach ($children as $child) { $tmp_dom = new DOMDocument(); $tmp_dom->appendChild($tmp_dom->importNode($child, true)); $innerHTML .= trim($tmp_dom->saveHTML()); } return $innerHTML; }
} $out .= ' </render_choice> </response_lid> </presentation> <resprocessing> <outcomes> <decvar maxvalue="100" minvalue="0" varname="SCORE" vartype="Decimal"/> </outcomes> '; $anss = $q->getElementsByTagName("response"); $fbs = array(); foreach ($anss as $ans) { $v = $ans->getAttribute("match"); $sc = $ans->getAttribute("score"); $txt = DOMinnerHTML($ans->getElementsByTagName("feedback")->item(0)); $fbs[$v] = htmlspecialchars($txt, ENT_XML1); if ($sc == 0) { } else { $correctv = $v; } } foreach ($fbs as $v => $txt) { $out .= '<respcondition continue="Yes"> <conditionvar> <varequal respident="' . $chpid . '_response' . $j . '">' . $chpid . '_item' . $j . 'r' . $v . '</varequal> </conditionvar> <displayfeedback feedbacktype="Response" linkrefid="' . $chpid . '_item' . $j . 'r' . $v . '_fb"/> </respcondition> '; }