xmlclass/xsdschema.py
changeset 1322 0a9227f743b3
parent 1315 ff14a66bbd12
child 1373 4278d5c1e414
equal deleted inserted replaced
1321:83f41ea00b97 1322:0a9227f743b3
   922     if factory.TargetNamespace == include_factory.TargetNamespace:
   922     if factory.TargetNamespace == include_factory.TargetNamespace:
   923         factory.Namespaces[factory.TargetNamespace].update(include_factory.Namespaces[include_factory.TargetNamespace])
   923         factory.Namespaces[factory.TargetNamespace].update(include_factory.Namespaces[include_factory.TargetNamespace])
   924     else:
   924     else:
   925         factory.Namespaces[include_factory.TargetNamespace] = include_factory.Namespaces[include_factory.TargetNamespace]
   925         factory.Namespaces[include_factory.TargetNamespace] = include_factory.Namespaces[include_factory.TargetNamespace]
   926     factory.ComputedClasses.update(include_factory.ComputedClasses)
   926     factory.ComputedClasses.update(include_factory.ComputedClasses)
       
   927     factory.ComputedClassesLookUp.update(include_factory.ComputedClassesLookUp)
       
   928     factory.EquivalentClassesParent.update(include_factory.EquivalentClassesParent)
   927     return None
   929     return None
   928     
   930     
   929 def ReduceRedefine(factory, attributes, elements):
   931 def ReduceRedefine(factory, attributes, elements):
   930     annotations, children = factory.ReduceElements(elements)
   932     annotations, children = factory.ReduceElements(elements)
   931     raise ValueError("\"redefine\" element isn't supported yet!")
   933     raise ValueError("\"redefine\" element isn't supported yet!")
  1090 """
  1092 """
  1091 def GenerateParserFromXSD(filepath):
  1093 def GenerateParserFromXSD(filepath):
  1092     xsdfile = open(filepath, 'r')
  1094     xsdfile = open(filepath, 'r')
  1093     xsdstring = xsdfile.read()
  1095     xsdstring = xsdfile.read()
  1094     xsdfile.close()
  1096     xsdfile.close()
  1095     return GenerateParser(XSDClassFactory(minidom.parseString(xsdstring), filepath), xsdstring)
  1097     cwd = os.getcwd()
       
  1098     os.chdir(os.path.dirname(filepath))
       
  1099     parser = GenerateParser(XSDClassFactory(minidom.parseString(xsdstring), filepath), xsdstring)
       
  1100     os.chdir(cwd)
       
  1101     return parser
  1096 
  1102 
  1097 """
  1103 """
  1098 This function generate a xml from the xsd given as a string
  1104 This function generate a xml from the xsd given as a string
  1099 """
  1105 """
  1100 def GenerateParserFromXSDstring(xsdstring):
  1106 def GenerateParserFromXSDstring(xsdstring):