Beispiel #1
0
# Not implemented

# 2. Get stuff out of the DTD1
elements = DTDParser.getElements(exampleDTD1)
dbHandler = DBHandler.DBHandler()
dbHandler.createNewTable(elements)
print 'DTD parser output:'
print elements
print ''

# 3. Get stuff out of the DTD2
# Not implemented

# 3. Fill database with stuff from the XML1 document and return the database
# Basic and very hacky version works, f**k you recursion

XMLParser.parseXML(exampleXML, dbHandler) # parses the xml doc and inserts rows into the sqlite db
print 'Database content after parsing xml doc:'
print dbHandler.executeQuery('select * from xmldata')

# 4. Take mappings from the user
# Not implemented

# 5. Construct the XML2 document
# Not implemented

# 6. Validate XML2 document against DTD2
# Not implemented

# cleanup
dbHandler.closeCursor()