Webload the XML format content returned by the parsing server

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.