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 7920189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:07:18+00:00 2026-06-03T16:07:18+00:00

how do i know a parent node’s name say i am at label =

  • 0

how do i know a parent node’s name say i am at label = “shirt”, how do i know that its parent is john_carter whose parent is “FG”. Is it possible to know ( in minidom )

-90

.
.
.

        <Object type="Layer" id="6" label="FG" expanded="True">
            <Properties>
                <Property id="blur" constant="True">
                    <Value>0</Value>
                </Property>
                .
                .
                .


                <Property id="objects" expanded="True" constant="True">
                    <Object type="Layer" id="7" label="john_carter">
                        <Properties>
                            <Property id="blur" constant="True">
                                <Value>0</Value>
                            </Property>
                            .
                            .
                            .


                            <Property id="objects" expanded="True" constant="True">
                                <Object type="Layer" id="8" label="shirt" selected="True">
                                    <Properties>
                                        <Property id="blur" constant="True">
                                            <Value>0</Value>
                                        </Property>
                                        .
                                        .
                                        .
                            .
                            .
                            .
                .
                .
                .


    .
    .
    .
  • 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-03T16:07:20+00:00Added an answer on June 3, 2026 at 4:07 pm

    Maybe like this?

    import xml.dom.minidom
    
    def getParentObjectNode(node):
        while node.parentNode:
            node = node.parentNode
            if node.nodeName == "Object":
                return node
    
    xml = xml.dom.minidom.parse("C:\\myxml.xml")
    for shirtNode in xml.getElementsByTagName("Object"):
        if shirtNode.getAttribute("label") == "shirt":
            break
    
    shirtParentObject = getParentObjectNode(shirtNode)
    print(shirtParentObject.getAttribute("label"))
    shirtParentParentObject = getParentObjectNode(shirtParentObject)
    print(shirtParentParentObject.getAttribute("label"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how to convert parent object that was return by
Just want to know how to read an attribute of a parent node from
I know that fork() returns differently for the child and parent processes, but I'm
I know that a style can be inherited in android via the parent property
i know i can have iframe in a html page, say parent.htm, and i
I would like to be able to determine if a parent node, whose ID
SELECT parent.name FROM categories AS node, categories AS parent, categories AS parent1 WHERE node.left_node
On clicking child, I want to know the parent index no. Example, there is
I would like to know how a listener should let the parent thread know
I know I can have 1 parent element and 1 child element in my

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.