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 QuarkXPress 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 QuarkXPress projects.

The AMS and the mappings from styles in QuarkXPress 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 QuarkXPress project. 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 QuarkXPress page onto a DTD element.

Creating mappings from QuarkXPress stylesheets

  1. From the Atomik Xport dropdown menu, choose ‘Edit Ruleset > Tutorial2.rls’

The Ruleset Editor will open on the Rules tab

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

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 QuarkXPress style. You now need to repeat this process to create mapping rules for the other styles in the QuarkXPress projects.

  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.

Table Paragraph Style Rules

Document Style  DTD Element 
Table Body  TableDataRow 
Table Head  TableHeadRow 
Table Notes  TableNoteRow 
Table Subtitle  TableTitleRow 
Table Title 

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 ‘Save’ 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 QuarkXPress page

  1. 1 Select the blue headline ‘GOLDEN GATE BAY HOTEL’ or a portion of the headline midway down page 1 of the QuarkXpress project as illustrated below.

If you are displaying Paragraph Styles QuarkXPress, 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 Press Ctrl + Shift and drag the selected 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 mappings to the HotelName element

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:

No Style Verdana 9pt B K

You have now created a rule directly from the page.

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