EasyManua.ls Logo

Adobe 0046100128056 - InDesign - Mac - Page 188

Adobe 0046100128056 - InDesign - Mac
209 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CHAPTER 13: XML Rules XML Rules Examples 188
function ProcessDevice(){
this.name = "ProcessDevice";
this.xpath = "/devices/device";
// Define the apply function.
this.apply = function(myElement, myRuleProcessor){
with(myElement){
//Add a return character at the end of the XML element.
insertTextAsContent("\r", XMLElementPosition.afterElement);
}
return true;// Succeeded
} //End of apply function
}
//Adds a return character at the end of the "name" XML element.
function ProcessName(){
this.name = "ProcessName";
this.xpath = "/devices/device/name";
// Define the apply function.
this.apply = function(myElement, myRuleProcessor){
with(myElement){
//Add static text at the beginning of the XML element.
insertTextAsContent("Device Name: ",
XMLElementPosition.beforeElement);
//Add a return character at the end of the XML element.
insertTextAsContent("\r", XMLElementPosition.afterElement);
}
return true;// Succeeded
} //End of apply function
}
//Adds a return character at the end of the "type" XML element.
function ProcessType(){
this.name = "ProcessType";
this.xpath = "/devices/device/type";
// Define the apply function.
this.apply = function(myElement, myRuleProcessor){
with(myElement){
//Add static text at the beginning of the XML element.
insertTextAsContent("Circuit Type: ",
XMLElementPosition.beforeElement);
//Add a return character at the end of the XML element.
insertTextAsContent("\r", XMLElementPosition.beforeElement);
}
return true;// Succeeded
} //End of apply function
}
//Adds a return character at the end of the "part_number" XML element.
function ProcessPartNumber(){
this.name = "ProcessPartNumber";
this.xpath = "/devices/device/part_number";
// Define the apply function.
this.apply = function(myElement, myRuleProcessor){
with(myElement){
//Add static text at the beginning of the XML element.
insertTextAsContent("Part Number: ",
XMLElementPosition.beforeElement);
//Add a return character at the end of the XML element.
insertTextAsContent("\r", XMLElementPosition.afterElement);
}
return true;// Succeeded
} //End of apply function
}

Table of Contents