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