From: preecej Date: Mon, 23 May 2011 22:08:16 +0000 (+0000) Subject: svn path=/; revision=95 X-Git-Url: http://gitweb.planteome.org/?a=commitdiff_plain;h=bc2620b67eba0befeaf406e5d0de2ce5bd2ea1d0;p=old-jaiswallab-svn%2F.git svn path=/; revision=95 --- diff --git a/preecej/semantic_wiki/prototyping/NCBI_eDocSummary.php b/preecej/semantic_wiki/prototyping/NCBI_eDocSummary.php new file mode 100644 index 0000000..7e38a66 --- /dev/null +++ b/preecej/semantic_wiki/prototyping/NCBI_eDocSummary.php @@ -0,0 +1,49 @@ +"); // inst. new xml doc for output + +// build xml doc with NCBI data +$DocSum = $xml_out->addChild("DocSum"); +$DocSum->addChild("Id",$NCBI_doc->DocSum->Id); + +foreach ($NCBI_doc->xpath("//Item") as $item) { + switch((string) $item["Name"]) { // Get attributes as element indices + case "PubDate": + $DocSum->addChild("PubDate",$item); + break; + case "Author": + $authorList[] = $item; + break; + case "LastAuthor": + $DocSum->addChild("LastAuthor",$item); + break; + case "Title": + $DocSum->addChild("Title",$item); + break; + case "Volume": + $DocSum->addChild("Volume",$item); + break; + case "Pages": + $DocSum->addChild("Pages",$item); + break; + case "FullJournalName": + $DocSum->addChild("FullJournalName",$item); + break; + } +} + +$author_list = ""; +foreach ($authorList as $author) { + $author_list = $author_list . $author . ", "; +} +$DocSum->addChild("AuthorList",rtrim($author_list,", ")); + + +header('Content-Type: text/xml'); // output xml doctype in your response +echo $xml_out->asXML(); +?> +