[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Fri Mar 19 00:16:00 UTC 2004


mwilkinson
Thu Mar 18 19:16:00 EST 2004
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv8455/Perl/MOBY

Modified Files:
	CommonSubs.pm 
Log Message:
dealing with serviceNotes block

moby-live/Perl/MOBY CommonSubs.pm,1.41,1.42
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2004/03/18 23:10:34	1.41
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2004/03/19 00:16:00	1.42
@@ -1019,6 +1019,47 @@
 
 
 
+
+=head2 getServiceNotes
+
+ name     : getServiceNotes
+ function :
+ usage    :
+ args     : 
+ returns  : 
+
+=cut
+
+
+sub getServiceNotes {
+    my ($result) = @_;
+    return ("") unless $result;
+    my $moby;
+    unless (ref($result) =~ /XML\:\:DOM/){
+        my $parser = new XML::DOM::Parser;
+        my $doc = $parser->parse($result);
+        $moby = $doc->getDocumentElement();
+    } else {
+        $moby = $result->getDocumentElement();
+    }
+    my @objects;
+    my @collections;
+    my @Xrefs;
+    my $success = 0;
+    my $responses = $moby->getElementsByTagName('moby:serviceNotes');
+    $responses ||= $moby->getElementsByTagName('serviceNotes');
+    my $content;
+    foreach my $n(0..($responses->getLength - 1)){
+        my $resp = $responses->item($n);
+        foreach my $response_component($resp->getChildNodes){
+            $content .= $response_component->toString;
+        }
+    }
+    return ($content);
+}
+
+
+
 =head2 getCrossReferences
 
  name     : getCrossReferences




More information about the MOBY-guts mailing list