Example 12-31: NewsStory.html page posts XML to SimpleNewsInsert.xsql

<HTML>
  <HEAD>
    <SCRIPT src="PostXMLDocument.js"></SCRIPT>
    <SCRIPT>
      function parseXMLinTextAreaAndPostIt(){
        // Create a new XML Parser Object
        var xmldoc  = new ActiveXObject ("Microsoft.XMLDOM");
        // Do the parsing synchronously
        xmldoc.async = false;
        // Parse the text in the TEXTAREA as XML
        xmldoc.loadXML(xmldocText.value);
        // Post the parsed XML document to the SimpleNewsInsert.xsql Page
        var response = PostXMLDocument(xmldoc, "SimpleNewsInsert.xsql");
        // Display the XML text of the response in the "StatusArea" DIV
        StatusArea.innerText = response.documentElement.xml;
     }
    </SCRIPT>
  </HEAD>
  <BODY>
    <b>Type in an XML Document in Moreover.com News Format to Post:<b><br>
    <TEXTAREA rows="7" style="width:100%" cols="70" name="xmldocText">
<moreovernews>
  <article>
    <url> http://technet.oracle.com/tech/xml </url>
    <headline_text> Oracle Releases XML Parser </headline_text>
    <source> Oracle </source>
  </article>
</moreovernews></TEXTAREA>
    <INPUT TYPE="button" Value="Post XML Document" 
           onclick=" parseXMLinTextAreaAndPostIt()">
    <br>Response:<hr>
    <DIV id="StatusArea" style="font-family:monospace"></DIV>
  </BODY>
</HTML>