W3C home > Mailing lists > Public > www-svg@w3.org > June 2000

creating and inserting a new node in javascript

From: Justin Friedl <justin.friedl@aspentech.com>
Date: Fri, 9 Jun 2000 17:51:52 -0400
Message-ID: <B1612D837360D111A9C000805FBBCCC901E87D15@geoffrey.sea.aspentech.com>
To: "'www-svg@w3.org'" <www-svg@w3.org>
In HTML I want to create create an entire new SVG document dynamically and
replace it with the current one?
thanks in advance
Justin

<html>
<head>
<title>Untitled Document</title>
<script language="javascript">

  function putXML(){
  // Load the XML 
  var source = new ActiveXObject("MSXML2.DOMDocument");
  source.async = false;
  source.load("http://friedlj1/xslXml/xslxml/gantt.xml");

  // Load the XSLT
  var style = new ActiveXObject("MSXML2.DOMDocument");
  style.async = false;
  style.load("http://friedlj1/xslXml/xslxml/ganttHeader.xsl");
  source.transformNode(style);
  var svgdoc = window.gantt.getSVGDocument();
  var contents = svgdoc.getElementById ('svgContents');
  var xxx = new ActiveXObject("SVGVIEWLib.IDOMDocument");    //how do I
create and new SVG document and how do I replace the old one?
  //newnode = contents.appendChild (newnode);
  }
</script>
</head>
<body onload="putXML()" bgcolor="#ffffff">
<embed SRC="../svg/dummy.svg" id="gantt" height="100%" width="100%"
type="image/svg-xml" pluginspage="http://www.adobe.com/svg/viewer/install/">

</body>
</html>
Received on Friday, 9 June 2000 17:51:58 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:18 GMT