內容管理 > PTC 伺服器連線 Document Bursting > Configuring the Default Naming Rules
  
Configuring the Default Naming Rules
In the atidefaults.bcf file, the contents of the defaultnamecriteria element controls how the PTC 伺服器連線 assigns names to new objects. The defaultnamecriteria element contains namerule elements, each with a unique setting for its rule attribute. The order of the namerule elements defines the default naming convention for all document elements created by Arbortext Editor and Arbortext Publishing Engine.
Adding an optional elementname attribute to a namerule element specifies that the rule is only used for elements of that type. (Refer to the following examples.)
The order of the available settings can be changed. The PTC 伺服器連線 follows the individual namerule settings from top to bottom. To eliminate one of the settings from the naming rules, remove it from the file. The following list shows the default order of the available naming rules.
topmost-is-filename — This rule will use the name of the file as the object name. This rule only applies to the topmost element in the file.
If a topmost-is-filename rule is specified in the system-wide defaults, it is used for all document types regardless of whether it is specified in the document-type-specific naming rules. If user-overrides are enabled, this setting is ignored in favor of the object name selected by the user. In this case, the length of the object's name is not limited to value of the createdefaults element's maxnamelen attribute.
division-head-content — If the element being named is a division element and has a header or title element, this rule will use the content of that header or title element for the object name. Elements that are used as division titles are configured in the document type's .dcf file. Note that the object name's length is limited to the value of the createdefaults element's maxnamelen attribute.
element-content — This rule uses the content of the element as the object name. Note that the object name's length is limited to the value of the createdefaults element's maxnamelen attribute.
element-name — This rule uses the element name as the object name.
expression — This rule uses a flexible expression involving one or more of the other naming rules. The expression naming rule requires the nameexpression attribute to be set. The value of this attribute is an expression that will be expanded to form the name of an object. The expression is a combination of fixed text and variable sub-expressions.
* 
If any sub-expression has an empty value, the entire expression will produce an empty value. If you use the expression rule, you should have a fallback naming rule that cannot fail.
Sub-expressions
Meaning
%division-head-content%
Content of the first nested division head tag.
%element-content%
Content of the first nested tag that has content.
%element-name%
The name of the element.
Consider the following markup.
<chapter>
<title>Bike Riding</title>
...
</chapter>
Assume that you apply the following naming rules to the markup.
<namecriteria>
<namerule rule="topmost-is-filename"/>
<namerule rule="expression" nameexpression=
"%division-head-content% (%element-name%)"/>
<namerule rule="expression" nameexpression=
"%element-content%-%element-name%"/>
<namerule rule="element-name"/>
</namecriteria>
This example would produce an object named: Bike Riding (chapter) because the %division-head-content% expression expanded to Bike Riding and the %element-name% expression expanded to Chapter.
xpath — This rule allows a name to be generated by evaluating an XPath 1.0 expression.
Consider the following markup.
<chapter>
<title>Bike Riding</title>
...
</chapter>
Assume that you apply the following naming rules to the markup.
<defaultnamecriteria>
<namerule rule="topmost-is-filename"/>
<namerule elementname="sect1" rule="xpath"
nameexpression="concat(text(),' (',name(),')')"/>
<namerule elementname="chapter" rule="xpath"
nameexpression="concat(title, ' (', name(), ')')"/>
<namerule rule="xpath"
nameexpression="concat(., '-', name())"/>
<namerule rule="element-name"/>
</defaultnamecriteria>
This example would produce an object named Bike Riding (chapter) because the title evaluated to Bike Riding and the name function returned chapter. The first rule was skipped because this was not the top-most element in the file. The second rule was skipped because it applies only to sect1 elements.
These settings can be overridden for a specific document type by using the namecriteria setting in a document-type-specific burst configuration file.