Documentation Center

Editing the Dynamic Import Mapping Rules

Click the Mappings tab to display the mapping rules.

Use the mapping rules to map element tags to Contenta objects, specify object names for the imported data and populate property sheet fields.

Use the Edit menu in Dynamic Import to create or modify the mapping rules. To manipulate text within the mapping rule fields, use standard Windows key strokes such as Ctrl+C to copy and Ctrl+V to paste. To find a specific mapping rule, use the Find Mapping option on the Edit menu or click the binocular (Find Mapping) icon.

When you save the data in this interface, it is written to a map file is saved under the Contenta_home/encaps/di/MapFiles directory. The filename is user-specified. The keyword in the map file to which the data in the field is saved, is noted in the description below.

FieldDescription
ElementThe SGML/XML element to be mapped. Enter the element name as it appears in your document.
  • If the document is XML, data in this field is case sensitive—that is, the case of the data in the field must match the case of the element as specified in the XML file.

Example: If the XML document contains the element Play, it must be entered as Play; not PLAY or play, in this field.

  • If the document is SGML, mixed-case in this field is acceptable; SGML parsers are not case sensitive.

In the map file, this field is saved to the keyword: ELEMENT

Mapping NoteNotes or comments about this mapping rule. In the map file, this field is saved to the keyword: RULENOTE
PCM ObjectThe Contenta object into which you want the Element imported. Select the object from the drop down list.

In map file, this field is saved to the keyword: PCMOBJECT

InThe occurrence of the element to be mapped—the parent element. You may indicate:
  • the word any for all occurrences; wherever the element appears.
  • a specific parent element (enter element tag in field); when the element appears within a specific parent element.
  • the tilde character '~' to specify not. Use it to eliminate an occurrence such as ~title (indicates "when not in the element title").
  • an element path (enter element tags in hierarchical order in field); when the element appears within a specific parent element path; add the minimum number of parents to eliminate ambiguity, for example: /document/chapter/title.

If the element is a child to multiple parent elements but in this mapping it is mapped to only one of the parent elements, the data in the element with the specified parent is placed in the PCM object as defined in this mapping. Data in all other occurrences of the element is written to the parent object (that is, when the element is found in another parent the data is written to the parent).

Example:

Title is an element whose parents are Chapter and Section. You map Title when it is in Chapter to a CompoundDoc, but do not map Title when it is in Section. Upon import, when Title is in Chapter, the data is imported into a CompoundDoc object. When Title is in Section, the data is maintained in the object created for Section.

Naming MethodThe method for naming the Contenta object. Names are 49 characters or less by default. However, the maximum name length for a given Contenta database can be set to a value from 49 to 100.

You can specify a name in the Naming Method field if there is a single occurrence of the element. The first character must be an alpha character. If there are several occurrences of the element, click the ... button to the right of the field to access the naming method window.

ElementSelect to specify that the data within the specified element tag is to be used as the name for the Contenta object; must be an immediate or direct child of the element being mapped. Specify the element tag in the field provided.
AttributeSelect to specify that the data in the element’s attribute is to be used as the name for the Contenta object. Specify the attribute tag in the field provided. If attribute contains '`' or ' ', it is converted to '_'. For example, if attribute is rajeev's act object, it is named rajeev_s_act.
Element NameSelect to specify that the name of the element is to be used as the name for the Contenta object. You must also specify if you want the name incremented (INCR) or not (NOINCR). If incremented, a numeric value is appended to each object name.
#FILENAMEEnter #FILENAME to specify that the base filename of the XML source file is to become the Contenta object name. You would probably only do this for the root element of the document. Use with the -t3 switch in the digui.cfg file. In the map file, this field is saved to the keyword: OBJNAME
Attribute MapUse to map the data in an element’s attribute list to Contenta object property sheet fields.
  1. Click the ... button to the right of the field to access the Map Tag Attributes... window.
  2. Map Tag Attributes window, type the name of the attribute in the field next to the property sheet field—the data in the specified attribute is written to the object’s property sheet field.

The fields in the window are defined in the pcmobjects file. In map file, this field is saved to the keyword: ATTRS.

NamespaceUse this field to specify the namespace for the element being mapped. If not using Namespaces, indicate NONE.

The default is NONE.

HierarchySelect the type of object that you specified in the PCM Object field.

Container — select for objects that will contain other objects. This is used for parent elements that are being defined.

Child — select for MRU objects (minimal revisable unit objects)— objects that will only contain data (will not be a parent object).

Specify child for all MRU objects. If you fail to specify child, MRU data in other elements under the same parent can be lost (that is, they will fail to be imported).

In map file, this field is saved to the keyword: HIER

PropSheet

Specify if you want the data defined in the Map Tag Attributes window to populate the object’s property sheet field(s)

Yes — select if you want the data specified in the Map Tag Attributes window to populate the property sheet field(s).

No — select if you do not want data specified in the Map Tag Attributes window to populate the property sheet field(s). If there are fields defined in theMap Tag Attributes window and the PropSheet field is set to No, the property sheet is not populated.

In map file, this field is saved to the keyword: PROPSHEET
AttributesSpecify if you want the data and property sheet field(s) defined in the Map Tag Attributes window to populate the object’s property sheet Attributes list.

Yes — select if you want the data specified in the Map Tag Attributes window to populate the property sheet Attributes list. The field is created under the Attributes tab and populated as indicated.

No — select if you do not want data specified in theMap Tag Attributes window to populate the property sheet Attributes list.

If fields in theMap Tag Attributes window are defined and the Attributes field is set to No, only the associated property sheet fields are populated—no fields are created under the Attributes tab.

In map file, this field is saved to the keyword: APPDATA

ContainsSelect if the Hierarchy field is Container. Select the type of object in the PCM Object field.

In map file, this field is saved to the keyword: CONTAINS

ChildSelect if the Hierarchy field is Child.
Data

Select Data when mapping MRU (minimal revisable unit) objects. (See the Note below)

HideSelect to skip hierarchical elements. For example, if the element rule for act is set to Hide and the hierarchy is:

<play>
<act>
<scene></scene>
<scene></scene>
<scene></scene>
</act>
</play>

The act start and end tags become content slices in the object mapped to play and the scenes become direct children of play.

After you have created the map file you can use it to split and import the SGML or XML document.