Loading ...
Sorry, an error occurred while loading the content.

40554Re: MSXML parser

Expand Messages
  • gistobias
    Mar 2, 2004
    • 0 Attachment
      Hi Mathias!

      Thank you for your help!

      I jave tried the MSXML-parser solution but i get stuck in the type
      mismatch jungle. I don't understand what to do with the items in the
      objNodeList below to get them into my SVG document. The code below
      generates a type mismatch error.

      function loadExt(testUrl){
      //testUrl is a URL to an SVG document on another server
      xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
      xmlDoc.async = false;
      xmlDoc.resolveExternals = false;
      xmlDoc.validateOnParse = false;
      xmlDoc.load(testUrl);
      if(xmlDoc.parseError.errorCode != 0){
      //...
      }else{
      var externalSvg = svgDoc.createElementNS(SVGNS, "svg");
      //externalSvg.value = belowSVGBase.xml;
      externalSvg.setAttribute("id", "dynamic");
      externalSvg.setAttribute("x", "101");
      externalSvg.setAttribute("y", "1");
      externalSvg.setAttribute("width", "100");
      externalSvg.setAttribute("height", "100");
      externalSvg.setAttribute("viewbox", "0 0 100 100");
      svgDoc.getElementById("main").appendChild(externalSvg);

      objNodeList = xmlDoc.documentElement.childNodes;
      for(var i=0; i<objNodeList.length; i++){
      svgDoc.getElementById("dynamic").appendChild
      (objNodeList.item(i)); // Type mismatch here
      }
      }
      }

      I would really appreciate some more help on this!

      regards
      Tobias


      --- In svg-developers@yahoogroups.com, "Mathias FATENE"
      <mathias.fatene@w...> wrote:
      > Addon :
      > look at this, it will give you the format :
      > http://lists.w3.org/Archives/Public/www-svg/2000Jun/0052.html
      >
      > Mathias
      >
      > -----Original Message-----
      > From: Mathias FATENE [mailto:mathias.fatene@w...]
      > Sent: Sunday, February 22, 2004 6:06 PM
      > To: svg-developers@yahoogroups.com
      > Subject: RE: [svg-developers] MSXML parser
      >
      >
      > Hi,
      > You can do that if the svg is embeded in HTML and the js script is
      in the
      > HTML part.
      >
      > Mathias
      >
      > -----Original Message-----
      > From: gistobias [mailto:ola_tobias@h...]
      > Sent: Sunday, February 22, 2004 5:46 PM
      > To: svg-developers@yahoogroups.com
      > Subject: [svg-developers] MSXML parser
      >
      >
      > Hi all!
      >
      > I tried to use ASV3 to parse and insert external SVG (getUrl() and
      > parseXML()) and that didn't work because of security limitations.
      Now
      > I have tried MSXML parser but when i try the code below I get the
      > error message "'ActiveXObject' is not defined". Does ASV block MSXML
      > parser or the creation of ActiveXObjects in general?
      >
      > <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
      > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG
      > 20010904//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
      >
      > <svg version="1.0" zoomAndPan="disable" id="main"
      > xmlns="http://www.w3.org/2000/svg"
      > xmlns:xlink="http://www.w3.org/1999/xlink"
      > onload="init(evt)"
      > >
      >
      > <script type="text/javascript">
      > <![CDATA[
      > var svgdoc;
      > var xmlDoc;
      >
      > function init(evt){
      > svgdoc=evt.target.ownerDocument;
      > xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
      > }
      > .
      > .
      > .
      >
      > /Tobias
      >
      >
      >
      > -----
      > To unsubscribe send a message to: svg-developers-
      unsubscribe@yahoogroups.com
      > -or-
      > visit http://groups.yahoo.com/group/svg-developers and click "edit
      my
      > membership"
      > ----
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      > -----
      > To unsubscribe send a message to: svg-developers-
      unsubscribe@yahoogroups.com
      > -or-
      > visit http://groups.yahoo.com/group/svg-developers and click "edit
      my
      > membership"
      > ----
      > Yahoo! Groups Links
    • Show all 15 messages in this topic