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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:03:59+00:00 2026-06-02T17:03:59+00:00

This is my xml file. – <deviceparameters> – <parameter componenttype=TextBox> <name>Operating Type</name> <oid>1.3.6.1.4.1.31163.5.1.1</oid> <writable>true</writable>

  • 0

This is my xml file.

- <deviceparameters>
       - <parameter componenttype="TextBox">
         <name>Operating Type</name> 
         <oid>1.3.6.1.4.1.31163.5.1.1</oid>  
         <writable>true</writable> 
         <description>The operating type defines which waveform type is used. This configuration takes several seconds to execute</description> 
       - <paramvalues type="Integer">
            <value default="No">123</value> 
         </paramvalues>
         </parameter>

       - <parameter componenttype="TextBox">
         <name>Active Waveform Status</name> 
         <oid>1.3.6.1.4.1.31163.5.1.2</oid> 
         <writable>false</writable> 
         <description>Show the status of the waveform configured by operatingType</description> 
       - <paramvalues type="String">
            <value default="yes">Active</value> 
      </paramvalues>
      </parameter>
    </deviceparameters>

I want to remove node with name ‘Active wavwform Status‘. How can I reomve that particular node from xml.

The code I have written is below.

rootElement = doc.getDocumentElement();
NodeList nList = doc.getElementsByTagName("parameter");
String nodeName = TF_name.getText();


System.out.println(""+nList.getLength());

for (int temp = 0; temp < nList.getLength();temp++)                
{
    Node nNode =  nList.item(temp);    
    Element eElement = (Element) nNode;
    String upname1 = getTagValue("name", eElement);

    if(upname1.equals(nodeName))
    {
        System.out.println("Parent:   "+nNode.getParentNode().getNodeName());
        System.out.println("nodename: "+nNode.getNodeName());
        System.out.println("rmoving ....");

        rootElement.removeChild(nNode);

        System.out.println("removed..."); 
    }                   
}                   
  • 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-02T17:04:00+00:00Added an answer on June 2, 2026 at 5:04 pm

    I got the answer.
    Actually I was deleting the node from my xml file, but I was not writing it to my xml file.
    I was missing following part

    TransformerFactory transformerFactory = TransformerFactory.newInstance();  
    Transformer transformer = transformerFactory.newTransformer();   
    DOMSource source = new DOMSource(doc);   
    StreamResult result = new StreamResult(selectedFile); 
    transformer.transform(source, result); 
    

    After long time study of code I found this silly mistake, so I corrected it.
    Anyways thanks for your reply.

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

Sidebar

Related Questions

I have this xml file <?xml version=1.0 encoding=UTF-8?> <bo:C837ClaimParent xsi:type=bo:C837ClaimParent xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:bo=http://somelongpathHere/process/bo> <claimAux> ...
Given this example XML file: <doc> <tag> Hello ! </tag> <tag> My name is
This is my XML File. <?xml version=1.0 encoding=utf-8?> <locstrings> <section name=section1> <locstring ID=sectionID1> <Name>SectionName1</Name>
I have this XML file: <continents> <continent1 id=EUR name=EUROPE></continent1> <continent2 id=AME name=AMERICA></continent2> </continents> I
i have an xml file that looks something like this <library> <book name=ABC> <chapter
i have this xml file <?xml version=1.0 encoding=utf-8?> <CRM> <Unit ID=1 Name=آذربایجان شرقی> <city
I have this xml file. <movies> <movie> <score>8.582207</score> <popularity>3</popularity> <translated>true</translated> <adult>false</adult> <language>en</language> <original_name>Transformers</original_name> <name>Transformers</name>
I have this xml file: <test time=11.11.2011 11:11 > <field type=one value=10/> <field type=two
I have this XML file: <?xml version=1.0 encoding=UTF-8 standalone=no?> <games> <game id=123456 name=501> <player
Imagine this XML file (sorry for sick example!!) <DOC> <Test> <Name>1 vs 100 Pre

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.