Parsing the XML Response
Get the root Node:var RootNode = document.wlxmls[0]. Xmldocument.documentelement
get the root node ' s name:rootNode.nodeName
get the root node ' s first Child:var fisrtchild = RootNode.childNodes.item (0)note:the text of a node is also a node. Case:get the performanceid:0p0000007e of below XML Dom<ArrayOfPerformanceIdObjectBase><PerformanceIdObjectBase> <PerformanceId>0P0000007E</PerformanceId> </performanceidobjectba Se> <PerformanceIdObjectBase><PerformanceId>0P000000Q0</PerformanceId></PerformanceIdObjectBase></ArrayOfPerformanceIdObjectBase>
functionInitagenda () {Wlglobals.parsexml=true}
Wlhttp.getxml=true;varXmlresponse = Document.wlxmls[0];varxmldoc =xmlresponse.xmldocument;varelement =xmldoc.documentelement;//InfoMessage ("The name of the root node is:" + element.nodename); varFisrtchildnode = Element.childNodes.item (0);//Get the <PerformanceId> node varPerfnode = FisrtChildNode.childNodes.item (0);//get the first <PerformanceIdObjectBase> node varPerfid = PerfNode.childNotes.item (0). NodeValue;//get the text node and get its value:0p0000007e
Webload the XML format content returned by the parsing server