我在我的google应用程序中创建了一个xml文档,并将其存储为blob,同时从数据存储取回如何将其再次转换为xml文档
class xmlStore(db.Model):
xmlRef=db.BlobProperty()如下所示创建xml文档:
docRef=Document()
fp=docRef.createElement("Client")
fp.setAttribute("ID","21783")
docRef.appendChild(fp)存储到数据存储区:
x=xmlStore(xmlRef=str(docRef))
x.put()在取回时:
result = db.GqlQuery("SELECT * FROM xmlStore").fetch(1)在网页上打印时:
for response in result:
self.response.out.write(response.xmlRef)它给了我xml.dom.minidom.Document instance at 0x6a2bddb0b5aef438
如何在xml中取回它。
发布于 2010-11-16 20:33:23
看看Python中关于xml.dom.minidom toxml method的文档。
你可以说:
正在提供位于0x6a2bddb0b5aef438的xml.dom.minidom.Document实例
调用该对象的.toxml()方法。
https://stackoverflow.com/questions/4193509
复制相似问题