[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Sat Jul 12 03:15:58 UTC 2003


mwilkinson
Fri Jul 11 23:15:58 EDT 2003
Update of /home/repository/moby/moby-live/Perl/scripts
In directory pub.open-bio.org:/tmp/cvs-serv15636/Perl/scripts

Modified Files:
	MOBY-Client05.cgi 
Log Message:
untested changes to print the text nodes

moby-live/Perl/scripts MOBY-Client05.cgi,1.9,1.10
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/MOBY-Client05.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- /home/repository/moby/moby-live/Perl/scripts/MOBY-Client05.cgi	2003/07/12 02:58:27	1.9
+++ /home/repository/moby/moby-live/Perl/scripts/MOBY-Client05.cgi	2003/07/12 03:15:58	1.10
@@ -224,32 +224,27 @@
             $XrefString .="<br>\n";
         }
         
-        #  this is an AWFUL hack necessary only because I base64 encode the response of a Blast service
-        # A blast report in the new API will inherit from String, so we can deal with this case.
         my $OBJ = "";
-        if ($obj =~ /BLAST/){
-            my $content = (($_ =~ /\<BLAST.*?\>(.*)\<\/BLAST/s) && ($1));
-            $OBJ .= "<pre>".escapeHTML(decode_base64($content))."</pre>";
-        } else {
-            $OBJ .= "<b>NameSpace: </b>$ns<br><b>ID:$id</b><br>";
-            my $Payload = $Object->getChildNodes();
-            foreach (0..$Payload->getLength-1){
-                next unless $Payload->item($_)->getNodeType == ELEMENT_NODE;
-                next if  ($Payload->item($_)->getTagName =~ /CrossReference/);
-                my $art = $Payload->item($_)->getAttributeNode('articleName');
-                if ($art){
-                    $art = escapeHTML($art->getValue());
+        $OBJ .= "<b>NameSpace: </b>$ns<br><b>ID:$id</b><br>";
+        
+        foreach ($Object->getChildNodes()){
+            my $data;
+            if ($_->getNodeType == TEXT_NODE || $_->getNodeType == CDATA_SECTION_NODE){
+                $data = $_->getValue;
+            } elsif ($_->getNodeType == ELEMENT_NODE){
+                next if  ($_->getTagName =~ /CrossReference/);
+                my $article = $_->getAttributeNode('articleName');
+                if ($article){
+                    $article = escapeHTML($article->getValue());
                 } else {
-                    $art = "";
+                    $article = "";
                 }
-                $OBJ .= "<b>$art (".escapeHTML($Payload->item($_)->getTagName).")</b> : ";
-                my $data = $Payload->item($_)->toString;
-                $data =~ s/\<.*?\>(.*)\<.*?\>/$1/;
-#                $OBJ .= "".escapeHTML($Payload->item($_)->toString)."<br>";
-                $OBJ .= "".escapeHTML($data)."<br>";
+                $OBJ .= "<b>$article (".escapeHTML($_->getTagName).")</b> : ";
             }
+#                $OBJ .= "".escapeHTML($Payload->item($_)->toString)."<br>";
+            $OBJ .= "".escapeHTML($data)."<br>";
         }
-        
+    
         $response .= "<td BGCOLOR = '#CCCCFF' valign='top' align='left'><SMALL>$XrefString$OBJ</SMALL></td></tr>\n"; #  HTML escaped XML of the object
     }
     $response .="</table>";




More information about the MOBY-guts mailing list