This discussion is archived
0 Replies Latest reply: Aug 13, 2012 6:07 PM by MarieR RSS

XmlResolver resolveSchema question

MarieR Newbie
Currently Being Moderated
Dear All,

I am somewhat confused by the behavior of XML resolvers and would appreciate advice. I wrote a subclass of XML Resolver to try to figure out the behavior, below is a Python snippet executed with dbxml 2.5.16 on a Windows 7 platform (compiled 32 bit, 64 bit os):

class Resolver(XmlResolver):

def __init__(self):
XmlResolver.__init__(self) # initialize parent class
print "Creating Resolver"

def resolveSchema(self, txn, mgr, schemaLoc, nameSpace):
print "Resolving schema %s to %s"%(nameSpace, schemaLoc)
# Use default resolver...
resolved= XmlResolver.resolveSchema(self, txn, mgr, schemaLoc, nameSpace)
print resolved
return resolved

I have registered the resolver and can see it execute when I try to add instance documents. As an example, I might add:

<Name> popo </Name>
<completename> Balaenoptera borealis </completename>
<coding> Bb </coding>

expecting it to fail due to the tag <bogus> which is not in the schema. External references are enabled, and I see the tethys.xsd is processed, but the value of resolved is None which I am not expecting as it is a valid address. Sample output:

addDocument ITIS: doc size=0.9 MB, 28 32768 byte pages...
Resolving schema to
Resolving schema to
Resolving schema to
Resolving schema to
Resolving schema to
Resolving schema to
Resolving schema to

What is more surprising is that tethys.xsd includes several other schema that are subsequently processed, all showing None as the resolved values intead of an XmlInputStream as expected.

My questions are:
1 - Why don't I see XmlInputStream objects?
2 - If I actually am processing the schema, am I doing something silly in my instance document that is keeping this from working?

Any ideas would be appreciated?

Thanks - Marie


  • Correct Answers - 10 points
  • Helpful Answers - 5 points