[MOBY-guts] biomoby commit
Yan Wong
yanwong at pub.open-bio.org
Thu Jan 27 13:46:57 UTC 2005
yanwong
Thu Jan 27 08:46:57 EST 2005
Update of /home/repository/moby/moby-live/Python/bioMoby
In directory pub.open-bio.org:/tmp/cvs-serv16293
Modified Files:
mobyDataTypes.py
Log Message:
moby-live/Python/bioMoby mobyDataTypes.py,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Python/bioMoby/mobyDataTypes.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Python/bioMoby/mobyDataTypes.py 2005/01/27 09:57:13 1.4
+++ /home/repository/moby/moby-live/Python/bioMoby/mobyDataTypes.py 2005/01/27 13:46:57 1.5
@@ -186,11 +186,11 @@
for aCross in child.childNodes:
if aCross.localName=="Xref":
aXref=MobyXref()
- aXref.fromMoby(aCross.toxml())
+ aXref.fromMoby(aCross)
self.__cross__.append(aXref)
if aCross.localName=="Object":
anObj=MobyObject()
- anObj.fromMoby(aCross.toxml())
+ anObj.fromMoby(aCross)
self.__cross__.append(anObj)
else:
#Do the same for the other objects
@@ -204,7 +204,7 @@
#Create an object
o=MobyObject()
- o.fromMoby(child.toxml())
+ o.fromMoby(child)
#if there is already an object, then store it inside a list and
#append the other objects in the list
@@ -247,16 +247,18 @@
"""Deserialize the Xref Object
"""
if isinstance(xml, str):
- doc=parseString(xml)
+ doc=parseString(xml).firstChild
doc=xml
-
- MobyObject.fromMoby(self, doc.firstChild)
+
+ uri=doc.namespaceURI
+
+ MobyObject.fromMoby(self, doc)
- self.authURI=doc.firstChild.getAttribute("authURI")
- self.serviceName=doc.firstChild.getAttribute("serviceName")
- self.evidenceCode=doc.firstChild.getAttribute("evidenceCode")
- self.xrefType=doc.firstChild.getAttribute("xrefType")
+ self.authURI=doc.getAttributeNS(uri, "authURI")
+ self.serviceName=doc.getAttributeNS(uri, "serviceName")
+ self.evidenceCode=doc.getAttributeNS(uri, "evidenceCode")
+ self.xrefType=doc.getAttributeNS(uri, "xrefType")
class MobyInteger(MobyObject):
More information about the MOBY-guts
mailing list