[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Sat Nov 1 04:40:58 EST 2003


mwilkinson
Sat Nov  1 04:40:58 EST 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv15771/MOBY

Modified Files:
	CommonSubs.pm 
Log Message:
Added the beginnings of an LSID resolver. It currently resolves only namespace type LSIDs.  Small changes to commonsubs to make it more robust to namespaced XML

moby-live/Perl/MOBY CommonSubs.pm,1.18,1.19
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/10/25 22:20:47	1.18
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/11/01 09:40:57	1.19
@@ -234,13 +234,13 @@
     if ($articleName) {
         return "
         <moby:queryResponse>
-            <Simple articleName='$articleName'>$data</Simple>
+            <moby:Simple articleName='$articleName'>$data</moby:Simple>
         </moby:queryResponse>
         ";
     } elsif($data) {
         return "
         <moby:queryResponse>
-            <Simple>$data</Simple>
+            <moby:Simple>$data</moby:Simple>
         </moby:queryResponse>
         ";
     } else {
@@ -276,26 +276,26 @@
     foreach (@{$data}){
         if($_) {
             $content .= "
-                <Simple>$_</Simple>
+                <moby:Simple>$_</moby:Simple>
             ";
         } else {
             $content .= "
-                <Simple/>
+                <moby:Simple/>
             ";
         }
     }
     if ($articleName) {
         return "
         <moby:queryResponse>
-            <Collection articleName='$articleName'>
+            <moby:Collection moby:articleName='$articleName'>
                 $content
-            </Collection>
+            </moby:Collection>
         </moby:queryResponse>
         ";
     } else {
         return "
         <moby:queryResponse>
-            <Collection>$content</Collection>
+            <moby:Collection>$content</moby:Collection>
         </moby:queryResponse>
         ";
     }
@@ -322,7 +322,7 @@
 
 sub responseHeader {
     return "<?xml version='1.0' encoding='UTF-8'?>
-      <moby:MOBY xmlns:moby='http://www.biomoby.org/moby'>
+      <moby:MOBY xmlns:moby='http://www.biomoby.org/moby' xmlns='http://www.biomoby.org/moby'>
         <moby:Response moby:authority='http://www.illuminae.com'>
         ";
 }
@@ -456,7 +456,7 @@
         $DOM = $doc->getDocumentElement();
     }
     $DOM = $DOM->getDocumentElement if ($DOM->isa("XML::DOM::Document"));
-    return 1 if ($DOM->getTagName eq "Collection");
+    return 1 if ($DOM->getTagName =~ /Collection/);
     return 0;
 }
 
@@ -673,8 +673,8 @@
     }
     my @xrefs; my @XREFS;
     my @simples;
-    return @XREFS if $XML->getTagName eq "Collection";
-    if ($XML->getTagName eq "Simple"){
+    return @XREFS if ($XML->getTagName =~/Collection/);
+    if ($XML->getTagName =~/Simple/){
         foreach my $child ($XML->getChildNodes){
             next unless $child->getNodeType == ELEMENT_NODE;
             $XML = $child;
@@ -683,16 +683,16 @@
     }
     foreach ($XML->getChildNodes){
         next unless $_->getNodeType == ELEMENT_NODE;
-        next unless $_->getTagName eq "CrossReference";
+        next unless $_->getTagName =~/CrossReference/;
         foreach my $xref($_->getChildNodes){
             next unless $xref->getNodeType == ELEMENT_NODE;
-            next unless ($xref->getTagName eq "Xref" || $xref->getTagName eq 'Object');
+            next unless ($xref->getTagName =~/Xref/ || $xref->getTagName =~ /Object/);
             push @xrefs, $xref;
         }
     }
     foreach (@xrefs){
-        $x = &_makeXrefType($_) if $_->getTagName eq "Xref";
-        $x = &_makeObjectType($_) if $_->getTagName eq "Object";
+        $x = &_makeXrefType($_) if $_->getTagName =~/Xref/;
+        $x = &_makeObjectType($_) if $_->getTagName =~ /Object/;
         push @XREFS, $x if $x;
     }
 	return @XREFS;



More information about the MOBY-guts mailing list