Adobe 0046100128056 Scripting Guide - Page 205
var myElement = myMatchData.element, whilemyMatchData != undefined
UPC - 718659087562
View all Adobe 0046100128056 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 205 highlights
CHAPTER 13: XML Rules Scripting the XML-rules Processor Object 205 main(); function main(){ var myXPath = ["/devices/device"]; var myXMLMatches = mySimulateXPath(myXPath); //At this point, myXMLMatches contains all of the XML elements //that matched the XPath expression provided in myXPath. function mySimulateXPath(myXPath){ var myXMLElements = new Array; var myRuleProcessor = app.xmlRuleProcessors.add(myXPath); try{ var myMatchData = myRuleProcessor.startProcessingRuleSet(app.documents. item(0).xmlElements.item(0)); while(myMatchData != undefined){ var myElement = myMatchData.element; myXMLElements.push(myElement); myMatchData = myRuleProcessor.findNextMatch(); } myRuleProcessor.endProcessingRuleSet(); myRuleProcessor.remove(); return myXMLElements; } catch (myError){ myRuleProcessor.endProcessingRuleSet(); myRuleProcessor.remove(); throw myError; } } }