4 Replies Latest reply on May 21, 2012 7:13 AM by Marcos Suárez

    Excluding xml elements in this script ...

    Marcos Suárez

      This script (Green4ever) insert "\r" after element:

       

      var myDoc = app.activeDocument;
      var inddRooElement = myDoc.xmlElements.item(0);
      var xPathElements = inddRooElement.evaluateXPathExpression("//*");
      var elementCount = xPathElements.length;
      for(var eId=0; eId<elementCount; eId++){
          var thisXpathElement = xPathElements[eId];
          thisXpathElement.insertTextAsContent("\r", XMLElementPosition.AFTER_ELEMENT);
          }
      alert("Done");

       

      But, I need some xml elements are excluded.
      How I can exclude some XML elements?
      How do exclude all items that have in the tag "<p>"?

       

      Thanks...