- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 12:33 AM
Can anyone confirm if this method still can be used in Helsinkin?
I have tried exact same samples in a script include and BR not returning any value.
http://wiki.servicenow.com/index.php?title=XMLDocument_Script_Object#gsc.tab=0
xmldoc.getNodes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 07:55 AM
Yes, it worked for me, with small modifications:
var xmlString = "<test>" +
" <one>" +
" <two att=\"xxx\">abcd1234</two>" +
" <three boo=\"yah\" att=\"yyy\">1234abcd</three>" +
" <two>another</two>" +
" </one>" +
" <number>1234</number>" +
"</test>";
var xmldoc = new XMLDocument(xmlString);
var nodelist = xmldoc.getNodes("//one/*"); // two, three, and two
gs.log(nodelist.getLength());
gs.log(nodelist.item(0).getNodeName());
gs.log(nodelist.item(1).getNodeName());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 01:57 AM
What's XMLDocument2()? Is it your own script include? Doesn't seem to be OOB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 08:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 08:54 AM
What's the error description you're gettin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 08:57 AM
getNodes() does not seem to be a valid API of XMLDocument2()