def createMetaDictionaryXsd(self): self.createMetaDictionaryDtd() # Convert DTD-dict to XSD-dict try: self.dictionary = convert.dtdDict2metaXsdDict( self.dictionary ) except: print 'Failed to convert information from a StGermain Meta DTD to a StGermain Meta XSD' raise
def createMetaDictionaryXsd(self): self.createMetaDictionaryDtd() # Convert DTD-dict to XSD-dict try: self.dictionary = convert.dtdDict2metaXsdDict(self.dictionary) except: print 'Failed to convert information from a StGermain Meta DTD to a StGermain Meta XSD' raise
def main(): dtd = testData.stgMetaDtdDict() xsd = convert.dtdDict2metaXsdDict(dtd) pprint.pprint(xsd) test = testData.stgMetaXsdDict() pprint.pprint(test) if test == xsd: print 'Passed' else: print 'Failed'
def main(): dtd = testData.stgMetaDtdDict() xsd = convert.dtdDict2metaXsdDict( dtd ) pprint.pprint( xsd ) test = testData.stgMetaXsdDict() pprint.pprint( test ) if test == xsd: print 'Passed' else: print 'Failed'
def loadXML(filename): xml_file = file(filename) xml_lines = xml_file.readlines() xml_text = "" for l in xml_lines: xml_text += str(l) try: dtdDict = stgDtd.readXML(xml_text) except: print 'Failed to parse as a StGermain DTD' raise try: return convert.dtdDict2metaXsdDict(dtdDict) except: print 'Failed to convert information from a StGermain Meta DTD to a StGermain Meta XSD' raise
def loadXML( filename ): xml_file = file( filename ) xml_lines = xml_file.readlines() xml_text = "" for l in xml_lines: xml_text += str(l) try: dtdDict = stgDtd.readXML( xml_text ) except: print 'Failed to parse as a StGermain DTD' raise try: return convert.dtdDict2metaXsdDict( dtdDict ) except: print 'Failed to convert information from a StGermain Meta DTD to a StGermain Meta XSD' raise