內容管理 > PTC 伺服器連線 Document Bursting > Configuring Naming Rules
  
Configuring Naming Rules
In a document-type-specific burst configuration file, the namecriteria element specifies how you want the document objects for this document-type to be named. If no namecriteria element is entered, the PTC 伺服器連線 will use the naming rules from the defaultnamecriteria element in the atidefaults.bcf file's system-wide burst configuration.
Note that if your defaultnamecriteria element in the system-wide burst configuration includes a topmost-is-filename rule, the name of the topmost element in a file will be the file name. The topmost-is-filename rule only needs to be included in document-type-specific naming rules when it is not included in the system-wide naming rules.
Adding an optional elementname attribute to a namerule element specifies that the rule is only used for elements of that type.
The optional operation attribute determines the conditions under which a naming rule applies. It can have the following values:
burst — The naming rule only applies when the elementname attribute is set and there is a matching element, and when the document object is created due to an object boundary rule in the boundaryspec element. The rule also applies when using the Object > Create Object from Selection menu choice to create an object from a selected part of a document.
import — The naming rule only applies when the elementname attribute is set and there is a matching element, and when the document object is created due to the import of a document (such as from a File > Save As Server Object operation).
* 
If this condition takes effect, all namerule elements that include a topmost-is-filename rule are ignored, whether they are in the system-wide burst configuration file or the document-type-specific burst configuration file.
any — The naming rule applies when the elementname attribute is set and there is a matching element, and when the document object is created by either an import or bursting operation.
* 
If this condition takes effect, all namerule elements that include a topmost-is-filename rule are ignored, whether they are in the system-wide burst configuration file or the document-type-specific burst configuration file.
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 document type configuration file (.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.
%import-filename%
The file name of the imported file, not including any file extension.
%import-filename-ext%
The file extension of the imported file.
%id-attr%
The value of the ID attribute defined in the document type configuration file (.dcf) file. If no ID attribute is defined in the .dcf file, the id attribute is used by default.
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.