Atomik Xport SE: Tutorials > Chapter 4 Tutorial 2: Creating Rulesets << >>

4.5 Defining Rules

The objective of this section of the Tutorial is to enable you to set up the mappings between typographical styles on the InDesign page and the XML elements defined by the DTD. These mappings enable the Atomik Xport Automated Matching System (AMS) to automate the extraction of XML from the InDesign document.

The AMS and the mappings from styles in InDesign to the XML elements in the DTD are the central features of Atomik Xport that make it such a powerful and flexible solution.

Once you have successfully loaded a DTD into Atomik Xport and named your Ruleset (as described above), you are ready to create the mappings that define the Ruleset.

You will see there are three main sections within the Ruleset Editor, two of which contain lists of names. The left-hand list has the title “Document Styles” – this is a list of the paragraph and character sheets used in the currently open InDesign document. Paragraph styles are listed first, followed by character styles. You will see style names such as ‘Bonus Box Text’, ‘Caption’, ‘Display Box Head’ and so on.

The list to the right of the ‘Document Styles’ list has the title ‘DTD Elements’. This list contains the elements defined in the Easy_Magazine.DTD file that you specified. You will see element names such as ‘Accomodation’, ‘Body”, “Brochure” and so on.

There are two possible ways to create a mapping rule

(i) By dragging and dropping the style name, for which you wish to create a mapping rule, from the Document Styles list onto an element.

(ii) By dragging and dropping a sample of the text, for which you wish to create a mapping rule, directly from the InDesign page onto a DTD element.

Creating mappings from InDesign styles

  1. 1 Open the Rules tab of the Ruleset Editor.
  2. Within the Document Styles list on the left-hand-side of the Ruleset Edtior, select the style ‘Hotel Text’
  3. Drag and drop this style onto the element ‘Body’ in the DTD Elements list (the right-hand list)
  4. Select the element ‘Body’ in the DTD Elements list to display its mappings.

New rule created for the ‘Body’ element

You will see that you have created a rule for the ‘Body’ element as illustrated above. The new rule you just created should look as follows:

Hotel Text

You have now created a rule using an InDesign style. You now need to repeat this process to create mapping rules for the other styles in the InDesign document.

  1. Try creating rules by mapping the styles listed below onto the corresponding XML elements. All you have to do is drag and drop the style sheet on the left onto the XML Element on the right as per the mapping table below.

Ignore the mapping of ‘Hotel Text’ to Body as you have already created rules for this style and element. Take care when creating the rules that you associate the styles with the correct DTD element.

Paragraph Style Rules

Document Style  DTD Element 
Bonus Box Head  HotelHead 
Hotel Name  HotelName 
Bonus Box Text  HotelText 
Running Header left  LocationName 
Running Header right 
Bonus Box Italic  OffersText 
Hotel Subhead  Subhead 
Tour Head  TourName 
Tour Intro  TourIntro 
Hotel Text  Body 
Caption  Caption 
Display Box Head  FacilitiesHead 
Display Box Text  FacilitiesBody 
Highlights Head  HighlightsHead 
Highlights Text  HightlightsBody 

Note: you do not need to create rules for the three ‘Running Footer’ styles.

Character Style Rules

Document Style:  DTD Element: 
MapReference  MapRef 
Stars  Rating 

There is no need to create any rules for the Normal character style sheet.

  1. Click ‘Apply’ to commit your mappings.

Once you have created a rule for each style you wish to extract to XML, the basic ruleset creation process is complete. In the next section you will learn how to create mappings directly from the page.

Creating mappings direct from the InDesign page

Note: In order to create mappings direct from the page you will need to have ‘Drag and Drop Text Editing’ enabled in InDesign. In Preferences > Type select the two checkboxes in the ‘Drag and Drop Text Editing’ section.

  1. 1 Highlight the blue headline ‘GOLDEN GATE BAY HOTEL’ or a portion of the headline midway down page 1 of the InDesign document as illustrated below.

If you are displaying Paragraph Styles InDesign, you will see that the hotel name ‘GOLDEN GATE BAY HOTEL’ has ‘[Basic Paragraph]’ associated with it, rather than the style ‘Hotel Name’. Without a mapped style, this text will not be extracted.

  1. 2 Drag and drop the highlighted text onto the element ‘HotelName‘ in the DTD Elements list (the right hand box of the two list boxes), as illustrated below.

Dragging and dropping text onto the ‘HotelName’ element

Ruleset Editor with the ‘HotelName’ element mapped

On the right hand side of the Ruleset Editor, there is a box that displays the mapping rules for whichever DTD element is selected. As you have just created a mapping to the ‘HotelName’ DTD element, the rule you just created will be displayed in this box as follows:

[Basic Paragraph]

Myriad Pro 10.0pt [USA blue] All Caps

You have now created a rule directly from the page.

  1. Click ‘Apply’ to commit your mapping to the ruleset.