Xoom features / Xoom Set Special Form |
<xoom:set> also supports include-self, insert-before and guard attributes.
If set to false (default), the include-self attribute indicates that only the content of the <xoom:set> elements should be deployed (at the node specified by the select attribute).
<Setting xoom:id="Setting[[Application]|Events|W6BFTask|]"> <Owner>[Application]</Owner> <Category>Events</Category> <SubCategory>W6BFTask</SubCategory> <Name /> <xoom:set select="Body/Events/Event[@Type='Diabsolut.Product.ClickSchedule.SchedulePriority.SetSchedulePriority, DiabsolutPT.ClickSchedule.SchedulePriority']" include-self="true"> <Event Type="Diabsolut.Product.ClickSchedule.SchedulePriority.SetSchedulePriority, DiabsolutPT.ClickSchedule.SchedulePriority" Active="true" /> </xoom:set> </Setting>
<Setting xoom:id="Setting[[Application]|Events|W6BFTask|]"> <Owner>[Application]</Owner> <Category>Events</Category> <SubCategory>W6BFTask</SubCategory> <Name /> <xoom:set select="Body/Events/Event[@Type='Diabsolut.Product.ClickSchedule.SchedulePriority.SetSchedulePriority, DiabsolutPT.ClickSchedule.SchedulePriority']" include-self="true" insert-before="Event[1]"> <Event Type="Diabsolut.Product.ClickSchedule.SchedulePriority.SetSchedulePriority, DiabsolutPT.ClickSchedule.SchedulePriority" Active="true" /> </xoom:set> </Setting>
The guard attribute takes the value of an XPath, that, if resolved, returns the value true and allows deployment to occur. If it returns the value false, deployment is prevented.
guard is used to prevent Xoom automatically creating and populating a new node when the XPath specified by the select attribute can't be resolved. For example, you may not want a new Agent Instance to be created when the node does not exist: the guard attribute prevents this.
In this example, we have set the guard attribute to have the same value as select.