From 94db05cfad11537c5f45d873f4ebe2b695970cb4 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 4 Mar 2009 21:02:00 +0000 Subject: [PATCH] added comments --- geni/util/rspec.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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() -- 2.47.0