0 Replies Latest reply on Jul 28, 2010 11:27 PM by Adobe-InDesign CS4

    How to check the XML Validation through JS-CS4 - Reg.

    Adobe-InDesign CS4 Level 1

      Dear All,

       

      I'm having the doubt about the "XML" validation through Javascript-Indesign. I tried so many ways

       

      var samp  = new XML("xml contents");

       

      but I can't validate and through the log messgage, Please kindly any one can give the solutions and suggestion.

       

       

      Another one doubt : Can we are able to use "XML Namespace in Javascript" like the below script :

       

      //=========================== Start =======================//

       

      #target indesign-6.0
      #include "glue code.jsx"
      var myDocument = app.activeDocument;
      var alltags = new Array;
      var i1 = 0;

          var myXPath =  "//ce:figure[@id]";
          var myRuleSet = new Array (new ProcessProduct);
          var myDoc = app.activeDocument;
          with(myDocument) {
              try {
                  var elements = xmlElements;
                  __processRuleSet(elements.item(0), myRuleSet);
                  }
              catch (err) {
                  alert (err);
                  }
              }

      alert(alltags.length)

      function ProcessProduct()
      {
          this.name = "ProcessProduct";
          this.xpath = myXPath;
          this.apply = function(myElement, myRuleProcessor)  {
              alltags[i1++] = myElement;
              }
          return true;
          }

      //=========================== End Script ============================//

       

      See here I used XML NameSpaces in "ce:figure" Element "var myXPath =  "//ce:figure[@id]";"

       

      So Please any one can tell me, how to use the XMLNameSpace in this Javascript.

      Thanks & Regards

      T.R.Harihara Sudhan