- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2015 08:28 AM
So I am currently playing around with the ECC queue to grab an handle the input XML payload in case of an error on an executed Powershell script.
I am running into an issue where the XML node "error" appears twice in the result. So it makes grabbing the second "error" node with the XMLDocument function "getNodeText()" particularly hard, as such function only takes the first occurrence.
Is anyone experiencing the same issue?
Or can somebody please help me to grab the second, not empty "error" node? Somehow I cannot find the proper way to iterate through the nodes and grab the not empty one. My skills in XML, XPATH and XMLDocument are really limited and I'm somehow not getting any more knowledgeable about it.
Thank you a lot
Kind regards,
Michel
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2015 06:48 AM
Another option that seem to work is to use getTextContent() on the node element like this:
var nodeValue = nodes.item(i).getTextContent();
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2015 07:31 AM
Thank you once again your expertise is much appreciated.
you can find the result in the following discussion: PowerShell Utility V2 - execute Powershell scripts directly from your instance