From 8b66772f20cfa3f4762645d52690bc5b4cbb719c Mon Sep 17 00:00:00 2001 From: Joshua Boverhof Date: Fri, 5 Sep 2003 18:57:54 +0000 Subject: [PATCH] ---------------------------------------------------------------------- Modified Files: XMLSchema.py -- added a try clause to catch xml.dom.ext ImportError, and added a SplitQName function that matches xml.dom.ext.SplitQName output. ---------------------------------------------------------------------- --- XMLSchema.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/XMLSchema.py b/XMLSchema.py index d269a68..68d7cd5 100755 --- a/XMLSchema.py +++ b/XMLSchema.py @@ -16,10 +16,22 @@ ident = "$Id$" import types, weakref, urllib, sys from threading import RLock -from xml.dom.ext import SplitQName from xml.ns import SCHEMA, XMLNS, SOAP, WSDL from Utility import DOM, Collection from StringIO import StringIO +try: + from xml.dom.ext import SplitQName +except ImportError, ex: + def SplitQName(qname): + l = qname.split(':') + if len(l) == 1: + l.insert(0, None) + elif len(l) == 2: + if l[0] == 'xmlns': + l.reverse() + else: + return + return tuple(l) def GetSchema(component): """convience function for finding the parent XMLSchema instance.