07-06-2016 12:35 PM
I am loading in an XML file and I need to remove an element. I am using the "Remove Child" method with an invoke node but it is not working at all and throws no errors.
I have access to the element that I want to remove so I get a reference to it's parent via the "Parent" property. I then use the reference to the parent with the "Remove Child" invoke node.
There is no error thrown at all. The following is the XML code and what is highlighted in red is the portion that I'm trying to remove.
So the element highlighted in red is the element that we are finding the parent of and trying to remove. It may be important to note that for debugging purposes I was looking at the XML that the element nodes had via the "Get XML" invoke node and the XML matched with what it should be. The parent node XML value was the <Control> element with the name "Test TD2" and the child was the XML highlighted in red. For some reason though, it just wont remove the XML at all. I'm not sure as to why and anything suggestions or thoughts would be greatly appreciated.
Solved! Go to Solution.
07-06-2016 03:27 PM
07-06-2016 03:39 PM
Do you mean to make sure that the element that I'm trying to remove and the parent of that element are what I expect them to be?
07-06-2016 03:45 PM
07-06-2016 03:50 PM
Yes it is proper. Here are images showing the XML of each element.
"XML" is the parent indicator and "XML 2" is the child indicator.
07-06-2016 04:06 PM
07-07-2016 02:10 AM
Try to share the Actual XML File You are using
07-07-2016 02:53 AM
Please Refer the Attached Code snippet with sample XML File
07-07-2016 08:06 AM - edited 07-07-2016 08:08 AM
07-07-2016 08:11 AM
@ben64 wrote:The best way to get help is to post your vi (not a picture of your code) and your file. The issue might be somewhere else.
Ben64
i have attached code snippet, hope we can use snippet as actual code