[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Thu May 8 22:54:34 UTC 2003
mwilkinson
Thu May 8 18:54:34 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv4744/Perl/MOBY
Modified Files:
Central.pm
Log Message:
should be able to discover by servicename
moby-live/Perl/MOBY Central.pm,1.46,1.47
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/05/08 21:44:42 1.46
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm 2003/05/08 22:54:34 1.47
@@ -1176,27 +1176,31 @@
my $article = $node->getAttributeNode("articleName");
$article = $article->getValue() if $article;
my $types = $node->getElementsByTagName('datatype');
- my $datatype;
- foreach ($types->item(0)->getChildNodes){ # should only ever be one!
+ my ($datatype, $def, $max, $min, @enums);
+ if ($types->item(0)){
+ foreach ($types->item(0)->getChildNodes){ # should only ever be one!
($_->getNodeType == TEXT_NODE) && ($datatype = $_->toString);
- }
+ }
+ }
my $defs = $node->getElementsByTagName('default');
- my $def;
- foreach ($defs->item(0)->getChildNodes){ # should only ever be one!
- ($_->getNodeType == TEXT_NODE) && ($def = $_->toString);
- }
+ if ($types->item(0)){
+ foreach ($defs->item(0)->getChildNodes){ # should only ever be one!
+ ($_->getNodeType == TEXT_NODE) && ($def = $_->toString);
+ }
+ }
my $maxs = $node->getElementsByTagName('max');
- my $max;
- foreach ($maxs->item(0)->getChildNodes){ # should only ever be one!
- ($_->getNodeType == TEXT_NODE) && ($max = $_->toString);
- }
- my $mins = $node->getElementsByTagName('min');
- my $min;
- foreach ($mins->item(0)->getChildNodes){ # should only ever be one!
- ($_->getNodeType == TEXT_NODE) && ($min = $_->toString);
- }
- my $enums = $node->getElementsByTagName('enum');
- my @enums;
+ if ($types->item(0)){
+ foreach ($maxs->item(0)->getChildNodes){ # should only ever be one!
+ ($_->getNodeType == TEXT_NODE) && ($max = $_->toString);
+ }
+ }
+ my $mins = $node->getElementsByTagName('min');
+ if ($types->item(0)){
+ foreach ($mins->item(0)->getChildNodes){ # should only ever be one!
+ ($_->getNodeType == TEXT_NODE) && ($min = $_->toString);
+ }
+ }
+ my $enums = $node->getElementsByTagName('enum');
my $numenums = $enums->getLength;
for (my $n=0;$n<$numenums;++$n){
foreach ($enums->item($n)->getChildNodes){ # should only ever be one!
More information about the MOBY-guts
mailing list