From aee745798b84ec94dfbbbd611d7b9ea5631ccb8e Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Mon, 26 Jan 2009 19:53:13 +0000 Subject: [PATCH] parse a string or a file. --- util/rspec.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/util/rspec.py b/util/rspec.py index 5445aa42..23e20f9f 100644 --- a/util/rspec.py +++ b/util/rspec.py @@ -7,11 +7,15 @@ from types import StringTypes class Rspec(): def __init__(self, xml = None, xsd = None): - self.xsd = xsd - self.rootNode = None - if xml: - self.parseString(xml) - + self.xsd = xsd # schema + self.rootNode = None # root of the dom + self.dict = {} # dict of the rspec. + if xml: + if type(xml) == file: + self.parseFile(xml) + if type(xml) == str: + self.parseString(xml) + self.dict = self.toDict() def _getText(self, nodelist): rc = "" -- 2.43.0