Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:18:36+00:00 2026-06-14T14:18:36+00:00

I am new to python and would like to understand parsing xml. I have

  • 0

I am new to python and would like to understand parsing xml. I have not been able to find any great examples or explanations of how to create a generic program to walk an XML nodeset.

I want to be able to categorize and identify all elements and attributes by name and value, without having any information about the xml schema. I don’t want to rely on calling elements and attributes specifically by tag name or text.

Could someone please point me in the right direction?

Thanks

UPDATE:

The specific question that was being asked was, “how do I generally recurse all nodes from the root node in an XML document without having any intimate knowledge about the schema.”

At the time, being new to python and understanding how to perform that operation in many other languages, I was perplexed by any real world examples that didn’t rely on named nodes to traverse the DOM, which isn’t what I wanted at all.

Hope this clarifies the question, as the information in this thread is indeed useful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:18:37+00:00Added an answer on June 14, 2026 at 2:18 pm

    Check out the documentation of ElementTree on the python help

    A basic stub of code from that page is:

        import xml.etree.ElementTree as ET
        tree = ET.parse(filename)
        root = tree.getroot()
        for child in root:  
          child.tag, child.attrib
    

    you can keep running for child in root: recursively downward until there aren’t any more children.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to OpenCV and would like to use its Python binding. When trying
Very new to python and can't understand why this isn't working. I have a
Thanks in advance for any help. I am new to python, but not particularly
I have been trying to understand python metaclasses, and so have been going through
Relatively new to Python.. I would like to know how to check if a
I am a new Python user and would like to do some simple image
I'm pretty new to Python programming and would appreciate some help to a problem
I would need some help in python. I'm new in python. I used to
I'm new to mechanize in python and it would be nice if someone could
I want to create a MSWindows Python program that would launch a new Firefox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.