The ElectricCommander ectool Reference and User Guide has an example of how to find a property. Navigating into a nested property sheet requires a different technique.
- To find all nested property sheets in one call (from any one object), use the getProperties call with the "recurse" option. This action returns an XPath object with the full hierarchy. (This technique is not recommended if the size of the entire returned XML text is more than about 500 KB.
- Use XPath to navigate through the returned result. Below is an example that reads an entire hierarchy and reproduces it on the current job. You can modify the hierarchy to do whatever you need, but the walking of the hierarchy should be the same either way. The first parameter is the XPath object containing the property sheet that was returned from getProperties.
Example Function Code
Example calling code
This top-level function iterates over property sheets calling the recursive function, passing in the top-level node of the xPath that is returned.
Note that expansion is disabled, because if there is a property reference INSIDE one of the properties, the copy function should just copy the property reference text (e.g, "$[/myStep/stepName]"). It should not try to expand it.
In Commander release 3.6 and after the following ectool command will perform the same as the above copy: