templateKey

Parent Previous Next

templateKey


The templateKey attribute has different functionality depending on which node the templateKey attribute is used alongside. If the templateKey is found within a Rule node, the templateKey is used to implicitly match objects found within the current Structure Map. If the templateKey is found within a ChildObjects or Object node, then the templateKey is used to explicitly override any Rule that would otherwise match that object.


Syntax

This rule will implicitly map all objects with an object type that matches the regular expression string "Smo\.Credential$" to the template mapped to the key "SqlCredential":



<Rule templateKey="SqlCredential" typeMatch="Smo\.Credential$" />



This ChildObjects node will return all children of the parent node and explicitly apply the template mapped to the key "SqlLogin":



<ChildObjects selector="./" templateKey="SqlLogin" >

</ChildObjects>



Associated Required Nodes

Rule - Used to implicitly match an object type or name with a template. At least one (default) Rule must be present within each Structure Map to ensure that all objects present within the Structure Map will be formatted regardless of whether or not an explicit or implicit templateKey match was found. The templateKey attribute is a required attribute for a valid Rule.


Associated Optional Nodes

ChildObjects - When the templateKey attribute is present under a ChildObjects node, then the templateKey is used to explicitly override any Rule that would otherwise match that object. The templateKey attribute is an optional attribute for a ChildObjects.


Object - When the templateKey attribute is present under an Object node, then the templateKey is used to explicitly override any Rule that would otherwise match that object. The templateKey attribute is an optional attribute for an Object.