How can I read data present in a large XML file using SAX parser?. I want to transfer the data from XML into tables created in MS Access.

Please help.
Regards,
Dinil

Hi,

first of all, Python has modules that allow you to parse. I haven't used SAX, but I've used DOM. Here's the reference for all Structured Markup Processing Tools in Python:
http://docs.python.org/lib/markup.html

Then, if your know the structure of your XML, the tags, the attributes, etc, it will be relatively easy to create the functions which parse the tags inward and extract the value of the attributes that interest you, which you can afterward send wherever you want:

Example:

def GetXmlList(XmlList):
    
    Dom = xml.dom.minidom.parse(XmlList)
    Root = Dom.getElementsByTagName(Root_Name)[0]

    # Scan base list
    Level1= dict()
    Node = GetChild(Root, LEVEL1_nameTag)
    for Child in Node.childNodes:
        if Child.nodeType == Child.ELEMENT_NODE:
            Name = str(Child.nodeName)
            if not Name in Level1:
                Level1[Name] = Child

    # Scan file list
    Level2 = dict()
    Node = GetChild(Root, LEVEL2_nameTag)
    for Child in Node.childNodes:
        if Child.nodeType == Child.ELEMENT_NODE:
            Name = GetAttribut(Child, LEVEL2_nameAttr)
            if Name in ...

            #do whatever you want...

    return Level1, Level2...

Did I enlighten a bit?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.