XML : Retrieve xml data using javascript

I have xslt, xml and javascript code as below, I want system to refresh insurancetype list when categoryid is select, kindly help. current source code cannot read to xml.

insurancetransaction.xsl

  <script language="JavaScript">  function updateInsType()  {  if (window.XMLHttpRequest)  {    xhttp=new XMLHttpRequest();  }  else  {     xhttp=new ActiveXObject("Microsoft.XMLDOM");   }    xhttp.open("GET","oess-config.xml",false);  xhttp.setRequestHeader("Content-Type", "text/xml");  xhttp.send(null);  xmlDoc=xhttp.responseXML;    if (xhttp.status==200)  {    }  else if (xhttp.status==404)  {  alert("XML could not be found");          }  }     </script>  ........  <tr>     <td class="label" width="15%">Category</td>     <td width="15%">       <select name="categoryid" class="field" onchange="updateInsType()">        <option value="0">All</option>          <xsl:choose>.....    

oes-config.xml

  <?xml version="1.0" encoding="UTF-8"?>  <config>  <common>  <insurancetype>          <desc id="1" shortname="GBG" cat="1" reportid="1">Burglary</desc>          <desc id="8" shortname="CECR" cat="2" reportid="1">Civil Engineering Completed Risks</desc>          <desc id="19" cat="1" shortname="FCL">Consequential Loss</desc>          <desc id="9" shortname="ECR" cat="2" reportid="1">Contractors' All Risks</desc>          <desc id="6" shortname="WWE" cat="1" reportid="1">Employer's Liability</desc>  </insurancetype>  </common>  </config>    

No comments:

Post a Comment