Arbortext Command Language > Functions by Alphabetical Listing > registerApplicabilitySyntax
  
registerApplicabilitySyntax
registerApplicabilitySyntax(name, test_xpath, expr_path, parser_class, parser_namespace[, "parser_and_operator"[, "parser_or_operator"[, "parser_not_operator"]]])
Registers a custom syntax for applicability.
name — the name of the syntax
test_xpath — an XPath expression that, when evaluated on an element, will advise if there is applicability for that element
expr_path — an XPath expression that retrieves the applicability expression for a particular element
parser_class — the classname of the parser for the syntax
parser_namespace — the namespace used for the syntax
The full namespaced name must be given so that the correct attribute can be added to the XML.
This parameter is required to support editing of applicability settings. It is not used when publishing.
parser_and_operator (optional)— the And operator used for syntax expressions in applicability attributes (default "&&")
parser_or_operator (optional)— the Or operator used for syntax expressions in applicability attributes (default "||")
parser_not_operator (optional) — the Not operator used for syntax expressions in applicability attributes (default "!!")
The operator parameters are only required if the custom syntax requires operators that are different to the default ones.
For example, this syntax is registered for ATO, the default applicability type shipped with Arbortext Editor:
applic::registerApplicabilitySyntax("ATO", "boolean(@*[namespace-uri() = 'http://arbortext.ptc.com/namespace/ATO' and local-name() = 'applic'])", "@*[namespace-uri() = 'http://arbortext.ptc.com/namespace/ATO' and local-name() = 'applic']" , "com.ptc.arbortext.applicability.representation.ATOParser", "appl")
Arbortext Editor ships with two applicability syntaxes: APEX and ATO.
Once registered, a custom syntax must be assigned to the current environment using inlineapplicabilitysyntax (as set command or advanced preference) before it can be referenced.
Related Topics
set inlineapplicabilitysyntax
Working with Applicability