Release Automation

Expand all | Collapse all

Delete/Add an XML attribute using XPath

Jump to Best Answer
  • 1.  Delete/Add an XML attribute using XPath

    Posted 12-20-2018 03:59 PM

    Hi, I'm in the need to erase  a supernode from nimi_config.xml and I want to use Delete an XML attribute using XPath action

     

    I tried the following option:

     

     

    But I get the following error:

     

     

    What I'm doing wrong?

     

    How can I add new execution servers on that file?

     

    Thanks.

     



  • 2.  Re: Delete/Add an XML attribute using XPath

    Posted 12-20-2018 04:02 PM

    Share the xml as well?



  • 3.  Re: Delete/Add an XML attribute using XPath
    Best Answer

    Posted 12-20-2018 10:46 PM

    Hi Julio,

     I think the reason you are facing a failure is because you are trying to remove element and not attribute but the action you are using is for attribute. Please use the action "Delete an XML element using XPath" and it will work.

    However, you need to put in check to make sure that the node exist in case you want action to only execute if the node is present else you will get an error.

     

     

    In case if you are fine with action to execute and fail/succeed you can uncheck "Pause on failure" in action setting.

     

    Regards,

    Saurabh



  • 4.  Re: Delete/Add an XML attribute using XPath

    Posted 12-21-2018 11:08 AM

    Hi Saurabh: Thanks for your help! The action worked as expected, however I cant add the new value:

     

     

    nimi_config.xml content:

     

    <supernodes>

    <!--<supernode>127.0.0.2:6900</supernode>-->
    </supernodes>

     

    Thanks



  • 5.  Re: Delete/Add an XML attribute using XPath

    Posted 12-23-2018 10:34 PM

    Hi Julio,

     To add a new value use the respective different action (from available RA actions), for example in case if you need to add an element, you can use Insert an XML element using Xpath, with below configuration.

     

     

    Let me know if it helps!

     

    Regards,

    Saurabh