From: Tony Mack Date: Wed, 4 Mar 2009 21:02:00 +0000 (+0000) Subject: added comments X-Git-Tag: sfa-0.9-0@14641~612 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=94db05cfad11537c5f45d873f4ebe2b695970cb4;p=sfa.git added comments --- diff --git a/geni/util/rspec.py b/geni/util/rspec.py index 5c77536a..6c440741 100644 --- a/geni/util/rspec.py +++ b/geni/util/rspec.py @@ -176,7 +176,7 @@ class Rspec(): """ def elementNode(tagname, rd): - element = minidom.Element(tagname) + element = minidom.Element(tagname) for key in rd.keys(): if isinstance(rd[key], StringTypes): element.setAttribute(key, rd[key]) @@ -188,7 +188,11 @@ class Rspec(): child = elementNode(key, item) element.appendChild(child) return element - + + # Minidom does not allow documents to have more then one + # child, but elements may have many children. Because of + # this, the document's root node will be the first key/value + # pair in the dictionary. node = elementNode(rdict.keys()[0], rdict.values()[0]) if include_doc: rootNode = minidom.Document()