Atomik Xport SE: Reference > Chapter 6 Working with Rulesets << >>

6.7 DTD tab

As you will have already learned, rulesets are always based on a DTD. At the time the ruleset is created, the DTD is imported into the ruleset and becomes the basis of the rules that are created. It is a common occurrence however, to need to make changes to the original DTD. There are several reasons that the DTD might require modification after the ruleset has been created, for example, if you wanted to add additional attributes to the elements or enable the DTD to work with new content that was previously not included in your DTD. In the initial setup process, which is largely iterative, you might make many versions of your DTD as you work to create the one that will work optimally with Atomik Xport.

Should your DTD be changed in this way, the underlying ruleset structure will need to be changed to reflect this. One way to do this is simply to create a new ruleset, based on the modified DTD. However if you have created a lot of rules already in Atomik Xport and the underlying changes in the DTD are not significant, the ‘Import DTD’ feature will save you much time.

‘Import DTD’ is located on the DTD tab of the Ruleset Editor and enables you to update the DTD embedded in your ruleset without requiring all of the rules to be recreated. This feature should be used as follows:

  1. 1 Click ‘Import DTD’ button (located on the DTD tab of the Ruleset Window).
  2. 2 In the ‘Select a DTD’ window choose the new DTD file
  3. 3 You are now offered the choice of backing up your ruleset before importing the DTD.

If you selected ‘Yes’ a copy of your original ruleset will be saved in the currently selected ruleset folder with the same name as the existing ruleset but ‘.bak’ appended to the end. If you selected ‘No’, you original ruleset will be replaced with the newly updated one. ‘Cancel’ will leave your existing ruleset unchanged.

  1. 4 Next you may be presented with a dialog determining what to do if an element in your ruleset is missing from the new DTD.

When importing a new DTD into an existing ruleset, Atomik Xport will compare the elements in the previous DTD with the ones in the new DTD. Elements which have the same name, will retain their rules. Elements which have rules in the previous DTD and which are no longer present in the new DTD structure will cause Atomik Xport to prompt you what to do with these rules:

The first option is to choose to re-map the rule to a different element.This allows for changes in spelling or capitalisation to be accounted for.

The second option is to delete the rules on the element which is not available in the new DTD.

The final option is to delete all rules on elements not available in the new DTD.

At the end of this process you should have an updated ruleset based on the new DTD with the rules remapped where necessary as you designated.

6.7.1 Element Roles

For images and their associated text, Atomik Xport provides a way of extracting them meaningfully irrespective of the chosen box ordering preferences. This approach is not based on mapping rules, but relies on you assigning roles to specified elements in your DTD.

You can assign roles from the Element Roles dialog:

1. In the DTD tab of the Ruleset Editor, click ‘Element Roles’

2. The Element Roles dialog will appear. Labels on the left list the roles of Image, Caption and Copyright Elements.

Against each role is a listbox allowing you to assign an element from your DTD.

3. The ‘Image Element’ listbox is populated with elements from your DTD that have the ‘EMPTY’ content model.

4. Select the element from your DTD that will represent images.

The ‘Caption’ and ‘Copyright Element’ listboxes will then populate with siblings of your designated Image Element.

5. Select the elements from your DTD that will hold caption and copyright text.

6. Press ‘OK’ to return to the Ruleset Editor, where the ‘Save’ button will be enabled for you to save your changes.