Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 152999

Re: How to remove the XML attribute value in Indesign file by javascript

$
0
0

Hi hasvi,

 

try the below code.

 


try{
    var myDoc = app.activeDocument;    var RtElement = myDoc.xmlElements[0];// here depends upon your document root nested any other element or direct.    var allElements = RtElement.xmlElements[0].evaluateXPathExpression("//following-sibling::*");    for(i=0; i<allElements.length; i++){        var myAttribute = allElements[i].xmlAttributes.itemByName("aid:pstyle");        if(myAttribute != null){            myAttribute.remove();            }        }    }catch(e){}
//_______________________________________________________________________________

 

 

thx,

csm_phil


Viewing all articles
Browse latest Browse all 152999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>