qtp - how to get the xml tag value using UFT 12.0 -
i have scenario read xml file tag value in uft
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> - <subcustbrk> <conn no="01415500228" /> <accno no="8500098" /> <site name="317009068" /> <sitelocdesc name="11098946" /> <servnumlable name="" /> <status /> <currency /> <dob>2015-03-26</dob> <invno /> <dobfrmt>2015 mar</dobfrmt> <month>march</month> <week>2015 w13(mar26)</week> <day>day 85</day> <dur>1558</dur> <calls>35</calls> <amt>1.337</amt> <mindate>2014-05-26</mindate> <maxdate>2014-06-25</maxdate> <bs>ssbs</bs> <servinfo>1</servinfo> <zerocalls>0</zerocalls> + <country> <row area="special services (08)" servtype="pstn" calltype="unknown" accesstype="indirect" calls="35" amt="1.337" dur="1558" int="0" flag="1" stndcalls="35" stnddur="1558" stndamt="1.337" econcalls="0" econdur="0" econamt="0.000" primcalls="0" primdur="0" primamt="0.000" /> </country> - <callednumbers> <row num="08445768263" servtype="pstn" calltype="unknown" accesstype="indirect" calls="13" amt="0.500" dur="583" area="special services (08)" stndcalls="13" stnddur="583" stndamt="0.500" econcalls="0" econdur="0" econamt="0.000" primcalls="0" primdur="0" primamt="0.000" /> <row num="08445768260" servtype="pstn" calltype="unknown" accesstype="indirect" calls="2" amt="0.106" dur="125" area="special services (08)" stndcalls="2" stnddur="125" stndamt="0.106" econcalls="0" econdur="0" econamt="0.000" primcalls="0" primdur="0" primamt="0.000" /> <row num="08445768262" servtype="pstn" calltype="unknown" accesstype="indirect" calls="18" amt="0.677" dur="788" area="special services (08)" stndcalls="18" stnddur="788" stndamt="0.677" econcalls="0" econdur="0" econamt="0.000" primcalls="0" primdur="0" primamt="0.000" /> <row num="08445768261" servtype="pstn" calltype="unknown" accesstype="indirect" calls="2" amt="0.054" dur="62" area="special services (08)" stndcalls="2" stnddur="62" stndamt="0.054" econcalls="0" econdur="0" econamt="0.000" primcalls="0" primdur="0" primamt="0.000" /> </callednumbers> - <detail> + <transaction type="pstn" servicetype="pstn" calls="35" units="0" amt="1.337" usage="usage" duration="1558" dob="2015-03-26" bs="ssbs" acc="0" filename="cmnp"> <h1>pstn</h1> - <h2> <c1 dt="text">call charges</c1> <c2 dt="text">rate period</c2> <c3 dt="number">no.of calls</c3> <c4 dt="number">units</c4> <c5 dt="money">r.o</c5> </h2> <sub_section type="unknown" categorytype="voice" rp="0" calls="35" units="0" duration="1558" amt="1.337" /> </transaction> </detail>
in xml need values of transaction tag servicetype="pstn" calls="35" how can read these values. can 1 me? thanx in advance.
this can done through eith xmlutil in uft or creating xml dom . please find example below .
xmldom1 =createobject("microsoft.xmldom") xmldom1.load(<xmlpath>) msgbox xmldom1.selectsinglenode("//transaction/@servicetype").text msgbox xmldom1.selectsinglenode("//transaction/@calls").text
Comments
Post a Comment