|Atomik Roundtrip 2.1: Tutorials||<< >>|
In this tutorial you will learn about using references to images within an XML file in Atomik Roundtrip.
The key stages in this tutorial are:
The objective of this tutorial is to provide an overview of how image files can be imported into QuarkXPress from an XML file generated by another application.
Whilst an XML file is simply in a text format, many XML files contain references to image files, which have relevance to the content of the XML file. In fact, XML files can contain references to many kinds of file, but as QuarkXPress is a desktop publishing application, we’re only interested in those files which QuarkXPress will be able to read.
<!-- XML note -->
There are two usual manners in which images will be presented as part of an XML file. The first is as an attribute. So far, these tutorials have only dealt with XML elements, as it is from these which Roundtrip primarily extracts its data. Elements are the data which appears between the tags : for example :
<Body>This is an element</Body>
An attribute is an additional piece of data which can be added to an element. They are usually used for storing metadata; information about the content, as opposed to the content itself. For example:
<Body Author=”Fred Flintstone” PublicationDate=”1963 BC”> This is an element</Body>
As you can see, the attribute is enclosed in the opening tag of an element. Now, when we’re dealing with images, then the image itself is not going to be included in the XML, as it’s not text, instead we’re going to include a reference to the file itself. As this reference is information about the element, rather than the actual image (i.e. the image data), then it’s logical to include it as an attribute. Commonly, this will lead to an element with no actual content, just attributes - known as an empty element. The format for notating an empty element is as follows:
<Image imageLocation=”Images/Picture1.tif” />
Notice the closing slash - this removes the requirement for a closing tag for this element.
The other manner in which images are presented is as an unparsed entity. An entity is like a shortcut to a value : so, for example, say you don’t want to have to type the text ‘imageLocation=”ServerVolume:UserFolders:MyFolder:Files:Images:CorporateLogos:MyLogo.TIF” ‘ every time you specify a commonly used image file, you can simply refer to it by a previously defined entity reference, for example:
<Image imageLocation=”&myLogo;” />, which is a lot easier both to write and to read, makes the XML less complex, and allows you to move the image file around and change it’s name without having to change all the XML which refers to it.
An entity is declared in the DTD, and so unparsed entities can only be used in valid XML files. In the DTD, our entity would be defined as
<!ENTITY myLogo SYSTEM “ServerVolume:UserFolders:MyFolder:Files:Images:CorporateLogos:MyLogo.TIF” NDATA TIFF>
We will discuss using only image path references in this tutorial.
The first item, Tag Name, is a pop-up menu that allows you to select which attribute contains the path to the image file, as it’s possible to have multiple attributes to the element. The contents of this pop-up will be all of the attributes which can be applied to this element - in the sample files there is only one attribute defined, ‘imgPath’.
The next option, Box Type, allows you to select the type of action which Import will perform when dragging an item to the page. If this is ‘Use existing box’, then Import will only let you drag the image to a picture box which has been drawn on the document. Should the box type be set to ‘Create Anchored Box’, then Roundtrip will allow you to drop the element into a text box, either on its own, or, more usually, as part of a parent element, and an anchored or inline picture box will be created, into which the picture will be imported. You can specify the size and other facets of this anchored box by clicking the ‘modify’ button in this dialog. Finally, if box type is set to ‘Create Floating Box’, then whenever you drag the parent element of an image into a text box, a new picture box will be drawn (one for each picture element which is a child of that parent element), and the picture imported into it.
The last option, Placement allows you to select how the image will be positioned or fit inside the picture box.
Note that you can import XML images into any kind of picture box, it doesn’t have to be a rectangular picture box.
In this tutorial we have: