[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Sep 16 22:21:02 UTC 2004


mwilkinson
Thu Sep 16 18:21:02 EDT 2004
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv15519/MOBY/Client

Modified Files:
	Central.pm 
Log Message:
as per Martin's observation, there is no need to pass the RDF as CDATA.  This required changes in both the client and server libraries.  Everyone needs to do a CVS update to use it

moby-live/Perl/MOBY/Client Central.pm,1.79,1.80
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2004/08/11 16:27:48	1.79
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2004/09/16 22:21:02	1.80
@@ -1656,7 +1656,7 @@
 	my $id = &_nodeTextContent($Object, 'id');
 	my $success = &_nodeTextContent($Object, 'success');
 	my $message = &_nodeTextContent($Object, 'message');
-	my $RDF = &_nodeTextContent($Object, 'RDF');
+	my $RDF = &_nodeRawContent($Object, 'RDF');
 	my $reg = MOBY::Client::Registration->new(
 		success		=> $success,
 		message 	=> $message,
@@ -1691,6 +1691,22 @@
     return $content;
 }
 
+sub _nodeRawContent {
+	# will get text of **all** child $node from the given $DOM
+	# regardless of their depth!!
+    my ($DOM, $node) = @_;
+    my $x = $DOM->getElementsByTagName($node);
+	unless ($x->item(0)){return};
+    my @child = $x->item(0)->getChildNodes;
+    my $content;
+    foreach (@child){
+        #print $_->getNodeTypeName, "\t", $_->toString,"\n";
+#        next unless $_->getNodeType == TEXT_NODE;
+        $content .= $_->toString;
+    }
+    return $content;
+}
+
 
 sub _nodeArrayContent {
 	# will get array content of all child $node from given $DOM




More information about the MOBY-guts mailing list