1 Reply Latest reply on May 10, 2013 6:55 AM by 2007ay

    Can i create a xmlDocument in Adobe ExtendScript toolkit

    2007ay Level 1

      hi all,

       

      i am using Adobe extendScript toolkit to write plugin for Adobe illustrator.

       

      and the same time i also want to convert my application object in to xml Document .

       

       

      first of all i want to know whether its is possilble? if yes know how ?

       

      as of know i used the given below code but its throwing some error "DOMParser dont not have constructor "

       


      function createXmlDocument(string)
      {
          var doc;
          if (window.DOMParser)
          {
              parser = new DOMParser();
              doc = parser.parseFromString(string, "application/xml");
          }
          else // Internet Explorer
          {
              doc = new ActiveXObject("Microsoft.XMLDOM");
              doc.async = "false";
              doc.loadXML(string);
          }
          return doc;
      }

       

       

      NOTE: actully i want to convert app.activeDocument in to xml documents (exc : docutmen1.xml).

       

      thanks

      Regards

      Ashish.

        • 1. Re: Can i create a xmlDocument in Adobe ExtendScript toolkit
          2007ay Level 1

          luckly i sloved my problem by the api given in extend java script;  the ans is :  read the file as string and use var xmlDoc = new XML(strData); it will convert ur strdata into xmlDocument exp

           

          :var xmlString =  <body>
          <div id="Layer_1" class="Layer_1">
          <div id="TextFrame_1" class="TextFrame_1"> This is the text Examples </div>
          </div>
          </body>

          try
          {
          var xmlDocument = new XML (xmlString);

          }catch (e)
          {
          alert(e);
          }

          Regards

          ashish yadav