Adobe 0046100128056 - InDesign - Mac Manual page 188

Javascript
Table of Contents

Advertisement

C
13: XML Rules
HAPTER
function ProcessDevice(){
this.name = "ProcessDevice";
this.xpath = "/devices/device";
// Define the apply function.
this.apply = function(myElement, myRuleProcessor){
} //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){
} //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){
} //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){
} //End of apply function
}
with(myElement){
//Add a return character at the end of the XML element.
insertTextAsContent("\r", XMLElementPosition.afterElement);
}
return true;// Succeeded
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
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
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
XML Rules Examples 188

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs5

Table of Contents