13 Replies Latest reply on Sep 24, 2015 12:28 AM by Vamitul

    Get elements using xpath

    Sudha K Level 1



      I need to get specific element in indesign document using xpath.  But its returning null dono why... Root element contains namespace. Whats the issue in this?? I have used the below code. Need to get section elements.



      Screen shot 2015-09-09 at 3.02.18 PM.png



      var doc = app.activeDocument;

      var myRoot = doc.xmlElements.item(0);

      alert("myRoot "+myRoot.markupTag.name)

      var elts = myRoot.evaluateXPathExpression("*");  //


      alert("elts:" +elts + "\nLength:"+elts.length) //



      Thanks in advance,

      Sudha K