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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:14:05+00:00 2026-05-23T11:14:05+00:00

I want to rename the existing XML node into new name. I am doing

  • 0

I want to rename the existing XML node into new name. I am doing XML parsing using DOM concept java, i have set of node which contains same name. for example

<names> 
    <abc>Apple</abc> 
    <abc>Ball</abc>
    <abc>Cat</abc> 
    <abc>Doll</abc> 
    <abc>Elephant</abc> 
    </names>

I the above example there is set of nodes contains value. in that example i want to change the node value (ie)

<names> 
    <name>Apple</name> 
    <name>Ball</name>
    <name>Cat</name> 
    <name>Doll</name> 
    <name>Elephant</name> 
    </names>

is this possible to do in DOM, i am pretty much new to parsing concept using DOM.. Thanks for valuable comments.

  • 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-05-23T11:14:05+00:00Added an answer on May 23, 2026 at 11:14 am

    Similar to my answer in updating a property of a xml tag :

    public void changeTagName(Document doc, String tag, String fromTag, String toTag) {
        NodeList nodes = doc.getElementsByTagName(fromTag);
        for (int i = 0; i < nodes.getLength(); i++) {
            if (nodes.item(i) instanceof Element) {
                Element elem = (Element)nodes.item(i);
                doc.renameNode(elem, elem.getNamespaceURI(), toTag);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to rename an existing table using SQL statement: I have already tried:
I have an existing file in my HDD and I want rename this file.
I have two files checked into GitHub: index.html backup.html Now I want to rename
I want to globally rename every node in an XML element by appending the
I have a file in a different folder I want to rename in perl,
I want to measure API evolution for a given Java project, in particular new/renamed
Does anybody know how to (easily) rename an existing grails application? I'm running into
I'm using IntelliJ IDEA 10.5.2 Example: Say I want to rename this class to
I have a file I need to rename to that of an existing file.
I currently have a php webpage. However, I want to break it down into

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.