import sqlite3
from xml.dom import minidom
def printAllTables(db_connect):
    sql_query = "SELECT name FROM sqlite_master   WHERE type='table';"
    cursor = db_connect.cursor()
    try:
        cursor.execute(sql_query)
        print(cursor.fetchall())
    except Exception as ex:
        jkl=0
    finally:
        cursor.close()
def insertIn(db_connect,code,description):
    cur=db_connect.cursor()
    sql='INSERT INTO AllDocuments VALUES(?,?)'
    try:
        cur.execute(sql,(code,description))
    except Exception as ex:
        jkl=0
    finally:
        cur.close()
path_db=r"C:\Rubtsov\Python\AxiomaPlugins\rosreestrXml\ui\tools\kptTools\KptSpravochnik.db"
db_connect=sqlite3.connect(path_db)
printAllTables(db_connect)
path_xsd=r"E:\Download\RossRestr\KPT_v10\KPT_v10\SchemaCommon\dAllDocumentsOut_v03.xsd"
dom = minidom.parse(path_xsd)
tags=dom.getElementsByTagName("xs:enumeration")
for tag in tags:
    code=tag.attributes.item(0).nodeValue
    tag_doc=tag.getElementsByTagName("xs:documentation")
    description=tag_doc[0].firstChild.data
    insertIn(db_connect,code,description)
db_connect.commit()
db_connect.close()