Extract the Infobox Part and Print the Values of XML Result

timer Asked: Mar 5th, 2014

Question description

hi can any one help me with this

 I want to extract the infobox part and print the values of this xml result ,separated by'= 'sign.

<?xml version="1.0"?><api><query><pages><pagepageid="14533"ns="0"title="India"><revisions><revcontentformat="text/x-wiki"contentmodel="wikitext"xml:space="preserve">{{about|the Republic of India}}
{{Use dmy dates|date=November 2013}}
{{Use Indian English|date=May 2013}}
{{Infobox country
|conventional_long_name = Republic of India
    |leader_title2 = [[Vice President of India|Vice President]]
    | National Congress|INC]])}}
    |leader_title4 = [[Speaker of the Lok Sabha|Speaker of the House]]
    |leader_name4 = {{nowrap|[[Meira Kumar]] (INC)}}
    |leader_title5 = [[Chief Justice of India|Chief Justice]]
    |cctld = [[.in]]
     {{collapsible list
      |title = other TLDs
      |[[.ভাৰত]] |[[.ভারত]] |[[.ભારત]] |[[.भारत]] |[[.ଭାରତ‌]] |[[.ਭਾਰਤ]] |[[.இந்தியா]] |[[.భారత్]] |[[بھارت.]]

this is what I did, I verified the regex expression online it match correct contain of the infobox. the problems is to read from the Json function Result1 and print the values

(result1) { 
       var myvalues = new Array();  
       var key = 0;
        for(i in result1.query.pages){
        key = i
        content = result.query.pages[key].revisions[0]['*'];
         v = content.match(?=\{Infobox)(\{([^{}]|(?1))*\});
                   myvalues = v.split("=");
          for(var x=0;x<myvalues.length;x++){



Tutor Answer

(Top Tutor) Studypool Tutor
School: New York University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors