XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure...

15
XML in InDesign Teaching Plan (5 Hours) Typesetting Training for Professionals B io tics E d u c a t i o n BIOTICS .IN Compiled by Biotics Faculties

Transcript of XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure...

Page 1: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

XML in InDesign Teaching Plan (5 Hours)

Typesetting Training for ProfessionalsBiotics

Education

BIOTICS.IN

Compiled by

Biotics Faculties

Page 2: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure
Page 3: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

XML in InDesign CS2Overview

7.1 XML Structure

7.1 Import XML tags

7.2 Apply XML tags

7.3 Mapping tags and styles

7.4 Use the Structure pane

7.5 Import XML

7.6 Export XML

7.7 Troubleshooting

Page 4: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

4 Compiled by: biotics education: www.biotics.in

Biotics Education XML in InDesign Training Jan 2010 4Bioti

cs Education

Overview

blls igys dh ge esa ds dks le>sa gesa dh tkudkjh gksuh pkfg,A blls gesa vius dke dks le>us esa dkQh enn feysxhA

XML Structure<?xml version=”1.0” encoding=”UTF-8”?>

<!DOCTYPE book SYSTEM “docdtd.dtd”>

<?xml-stylesheet type=”text/xsl” href=”food.xsl”?>

<!ENTITY ext1 SYSTEM “isoamsn.ent”>

<book>

<chapter>

<title id=”chapter5”>5</title>

<subtitle>Food</subtitle>

<para>We need food to stay healthy and grow strong. We eat different kinds of food. They contain useful substances called nutrients. Carbohydrates, fats, proteins, vitamins and minerals are the main nutrients present in our food.</para>

<para>Food is divided into three categories: energy- giving, body-building and protective.</para>

<sect1>

<title>Energy-giving foods.</title>

<entry align=”left” valign=”top”>

<para>They give us heat and energy to work and play. They also keep our skin and hair healthy. <emphasis role=”bold”> Carbohydrates</emphasis> and are energy- giving nutrients. x &#8808; 1200</para></entry>

<figure>

<graphic fileref=”images/junk food.jpg” format=”JPG” align=”center”/>

</figure>

</sect1>

</chapter>

</book>

XML Document

XML Version Declarations dkSu lk fd;k tk jgk gSA ftlls ;g irk pyrk gS fd veqd fd;k gqvk gS

Encoding Declarations

dtd (Document Type Definition)blesa esa gksus okys lkjs fd;s gksrs gSaA vxj esa dksbZ ,slk fd;k tkrk gS tks

esa ugha gS rks ugha gks ikrh gSA

XML dtd Declarationdk uke fy[kk tkrk gS ;kfu ml dks fd;k tkrk gSA

XSL (Extensible Stylesheet Language)ftl izdkj ge dksbZ cukrs gSa vkSj mldh djrs gSa mlh rjg dk

djrh gSA ;kfu nwljs ’kCnksa esa dh gSA

Page 5: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

Compiled by: biotics education: www.biotics.in 5

Biotics Education XML in InDesign Training Jan 2010 5Bioti

cs Education

XML Version Declarations dkSu lk fd;k tk jgk gSA ftlls ;g irk pyrk gS fd veqd fd;k gqvk gS

Encoding Declarations

dtd (Document Type Definition)blesa esa gksus okys lkjs fd;s gksrs gSaA vxj esa dksbZ ,slk fd;k tkrk gS tks

esa ugha gS rks ugha gks ikrh gSA

XML dtd Declarationdk uke fy[kk tkrk gS ;kfu ml dks fd;k tkrk gSA

XSL (Extensible Stylesheet Language)ftl izdkj ge dksbZ cukrs gSa vkSj mldh djrs gSa mlh rjg dk

djrh gSA ;kfu nwljs ’kCnksa esa dh gSA

Page 6: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

6 Compiled by: biotics education: www.biotics.in

Biotics Education XML in InDesign Training Jan 2010 6Bioti

cs Education

XSL Declarationesa esa vkus okyh ;s ml ds fy, dks djrh gSA

food.xsl

XML Entity

“isoamsn.ent”

isoamsn.ent

Page 7: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

Compiled by: biotics education: www.biotics.in 7

Biotics Education XML in InDesign Training Jan 2010 7Bioti

cs Education

Root Element

Tags

Child Element

<sect1>

<title>Energy-giving foods.</title>

<entry align=”left” valign=”top”>

<para>They give us heat and energy to work and play. They also keep our skin and hair healthy. <emphasis role=”bold”>Carbohydrates</emphasis> and are energy- giving nutrients. x &#8808; 1200</para>

</entry>

mnkgj.k ds fy, bl esa tgk¡ gS mldk gSA ijUrq D;ksafd tks fd ds vUnj vk jgk gS blfy, dk dgyk;sxk vkSj

Attribute

Content

Unicode

Valid

Well Formed

Page 8: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

8 Compiled by: biotics education: www.biotics.in

Biotics Education XML in InDesign Training Jan 2010 8Bioti

cs Education

;kfu vc rd ge le>s fd%

dks ekuk tkrk gS D;ksafd ;k esa ckj&ckj ugha gksrk gSA D;ksafd ;g iwjh rjg ls gksrk gS dksbZ Hkh blesa ugha fd;k

tkrkA vkSj dksbZ Hkh ckj ckj ,d gh dks Bhd ugha djuk pkgrkA og mlh dk djuk pkgrk gSA

esa dh dh tkrh gSA tks ls vkSj ls gksrh gSA tSls% <para>Food is divided into three categories: energy- giving, body-building and protective.</para>

esa tks dh tkrh gS] og esa gksrh gSA /;ku j[kuk pkfg, fd esa mUgha dks djuk pkfg, tks esa dj j[ks gksaA ojuk og ugha gks ikrh

gSA vFkkZr mlesa jg tkrh gSA

ds fy, dh djuh gksrh gSA tSls% <emphasis role=”bold”>...</emphasis>: for bold <graphic fileref=”images/junk food.jpg” format=”JPG” align=”center”/> ... </graphic> : for calling graph

;gk¡ ;s ckr /;ku nsus okyh gS fd dsoy dks gh fd;k tkrk gSA dHkh Hkh dsk ugha fd;k tkrk

ls ml dks fd;k tkrk gSA esa gh lkjh dh xbZ gksrh gSA

ds tfj;s mldh dh tkrh gSA ;kfu dh tkrh gSA

ds tfj;s lkjs dh dh tkrh gSA ;s ;k nksauks gh :i esa gks ldrs gSaA

vc gekjs ikl tks gS

From XML Person From Setup Person

;kfu dqy feykdj ftruk t:jh Fkk oks lkjk gekjs ikl vk pqdk gS vkSj ge mlds ckjs tkudkjh rks ys gh pqds gSa ftruh t:jh Fkh rks

vc ge vc ge le>saxs fd fdl izdkj dks djrk gSA

Getting Started XML with InDesign CS2eku yhft, vki lk/kkj.k rjhds ls djrs gSa rks vki D;k djrs gks\ vkidk tckc gksxk

dh djrs gSa fQj ml dks esa dj ysrs gSaA vxj dksbZ esa xyr yx x;k gS rks mls esa Bhd yxk ysaxsA

fcYdqy lghA ;gh dk Hkh gksrk gS tgka djds nsrk gS vkSj tc ge dks esa fd;k tkrk gS rks vius vki gh lkjs yx tkrs gSa gesa flQZ djuh gksrh gS tSls

lgh rjhds ls djuh gksrh gSaA

;gk¡ ;s ckr ?;ku nsuh okyh gS fd esa ogh dh djrk gS tks mls nh tkrh gSA ;kfu gksrh gSA

vc ge FkksM+k lk djrs gSa vkSj ;s dgrs gSa fd ,d vkidks vkidh ds fglkc ls ugha cfYd vius ds fglkc ls djds nsrk gSA mls ugha irk vkius viuh esa dkSu&dkSu ls cuk;s gSa mlus rks cl

dh vkSj vkidks idMk+ nsrk gSA

;kfu vc vkids ikl vk pqdh gSA ij ;gk¡ ;s ckr /;ku nsus okyh gksrh gS fd vki bl dks fdl izdkj ls viuh esa djk;sxsA

Step 1: tc vki djds djrs gks rks ogk¡ gks jgk gksrk gSA vc vkidks fuEufyf[kr

ysus gksaxsA

Step 2: tSls gh vki djksxs ds mij gks tk,xhA

Page 9: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

Compiled by: biotics education: www.biotics.in 9

Biotics Education XML in InDesign Training Jan 2010 9Bioti

cs Education

Step 3: djrs gh esa ij gks tk,xh vkSj ds vUnj lkjs

gks tk,saxsA

Step 4:

Importing XML Fileigyh ckr rks ;s fd lk/kkj.k dh Hkk¡rh

ugha djkbZ tkrhA bls nks rjhdksa ls fd;k tk ldrk gSA

esa tks

vk;k gS mlds esa tks fn[k jgk gS ml ij dhft, vkidks

dk fn[kkbZ nsxkkA mlls dks fd;k tk

ldrk gSA

Manual Layout

Automatic Layout

tSlk fd vkidks igys crk;k x;k Fkk fd vkidks vkidh ds fglkc ls ugha cfYd vius ds fglkc ls djds nsrk gSA mls ugha irk vkius viuh esa dkSu&dkSu ls cuk;s gSa mlus rks cl

dh vkSj vkidks idMk+ nsrk gSA vc vki dks dj pqds gks yfdu vc vkidks irk pyrk gS fd cgqr ls vkidh esa cuk;s x;s ls ugha djrsA

vkids ikl vc nks rjhds gSa fd ;k rks vki gj ij ,d&,d djds lgh yxk;sa ;k dj ysaA vc loky mBrk gS ;s gksrh D;k gSA

Figure 8.1 Manual Importing the XML Coded File.Figure 8.1 Manual Importing the XML Coded File.

Page 10: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

10 Compiled by: biotics education: www.biotics.in

Biotics Education XML in InDesign Training Jan 2010 10Bioti

cs Education

What is Mapping

bl esa esa vkSj esa dh ns j[kh gSA ;gk¡ esa us esa tks fd;s gSa mudh gS vkSj esa tks

us cuk;s gSa mudh gSA vc vkidks djuk ;s gS fd vki /;kuiwoZd dks Bhd ls djk ysaA bl rjg dh enn ls vki ,d ckj esa gh lkjh

viuh t:jr ds vuqlkj dj ldrs gSA vkSj ds fy, Hkh blh dks djds j[k ldrs gSaA

djus ds fy, vkidks viuh ,oa dks djuk gksxk mlh dh enn ls vki ;g tku ikvksxs fd us gjsd ds fy, dkSu&dkSu lk fd;k gSA rHkh vki mls viuh ds fglkc ls djk ikvksxsA lkekU;r% dks ds vUnj djus ls igys gh djuh pkfg,A

Paragraph and Character Style AttributestSlk fd vkidks vHkh rd irk yxk fd vki dks ds )kjk djk ldrs gSaA ijUrq vki dks dSls djk;saxs\ esa gjsd fQj pkgs oks ;k dksbZ vkSj dh gks lcds fy, ,d gh rjhds ls

dh tkrh gSA tSls% <emphasis role=”bold”> ... </emphasis> ;k <emphasis role=”italic”> ... </emphasis>

vc tc vki viuh esa djds djus yxrs gks rks vkidks gj ds fy, flQZ ,d gh feyrk gSA vc vki D;k djksxs\

blds fy, esa vkidks djuh gksrh gSA oks dSls%

Recieved XML Coded File Alteration in XML Coded File

<?xml version=”1.0” encoding=”UTF-8” ?>

<!DOCTYPE Recipe SYSTEM “food.dtd”>

<root>

<para>They give us heat and energy to work and play. They also keep our skin and hair healthy. <emphasis role=”bold”>Carbohydrates</emphasis> and are energy- giving nutrients. x &#8808; 1200</para></entry>

</root>

<?xml version=”1.0” encoding=”UTF-8” ?>

<!DOCTYPE Recipe SYSTEM “food.dtd”>

<root xmlns:aid=”http://ns.adobe.com/AdobeInDesign/4.0/”>

<para aid:pstyle=”tx”>They give us heat and energy to work and play. They also keep our skin and hair healthy. <emphasis aid:cstyle=”bold”>Carbohydrates</emphasis> and are energy- giving nutrients. x &#8808; 1200</para></entry>

</root>

Tables Attributesblh izdkj ds fy, Hkh esa vkidks djuh gksrh gSA rkfd tc vki esa djsa vkidks cuh cukbZ

fey ldsA

Attribute Value Descriptiontable table

cellSpecifies a table-type element. A value of “table” indicates the container TABLE element;

A value of “cell” indicates a cell element.

trows Numeric Specifies the number of ROWS in the table. Used only in the Table element.

tcols Numeric Specifies the number of COLUMNS in the table. Used only in the Table element.

theader Empty If present, the theader attribute indicates that the current cell is part of a TABLE HEADER row.

crows Numeric Specifies how many ROWS the CURRENT CELL SPANS. The default is 1.

ccols Numeric Specifies how many COLUMNS the CURRENT CELL SPANS. The default is 1.

ccolwidth Numeric Specifies the WIDTH, in points, of the CURRENT CELL.

tfooter Empty If present, the tfooter attribute indicates that the current cell is part of a TABLE FOOTER row.

Page 11: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

Compiled by: biotics education: www.biotics.in 11

Biotics Education XML in InDesign Training Jan 2010 11Bioti

cs Education

Table Header 1 Table Header 2 Table Header 3 Table Header 4A B C D

E straddles two columns F G

H IJ straddles two rows

K

L M NTable footer

<Table xmlns:aid=”http://ns.adobe.com/AdobeInDesign/4.0/” aid:table=”table” aid:trows=”6” aid:tcols=”4”>

<Cell aid:table=”cell” aid:theader=”” aid:crows=”1” aid:ccols=”1”>Table header 1</Cell>

<Cell aid:table=”cell” aid:theader=”” aid:crows=”1” aid:ccols=”1”>Table header 2</Cell>

<Cell aid:table=”cell” aid:theader=”” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>Table header 3</Cell>

<Cell aid:table=”cell” aid:theader=”” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>Table header 4</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid: ccolwidth=”130”>A</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”59”>B</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>C</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>D</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”2”>E straddles two columns</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>F</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>G</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>H</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”59”>I</Cell>

<Cell aid:table=”cell” aid:crows=”2” aid:ccols=”1” aid:ccolwidth=”130”>J straddles two rows</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>K</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>L</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”59”>M</Cell>

<Cell aid:table=”cell” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>N</Cell>

<Cell aid:table=”cell” aid:tfooter=”” aid:crows=”1” aid:ccols=”1” aid:ccolwidth=”130”>Table footer</Cell>

</Table>

Understand/Learn the other Terms of InDesign XML

The aid:trows and aid:tcols attributes specify the number of rows and columns in the table.

The empty aid:theader attribute indicates a heading cell. Footing cells use a similar aid:tfooter attribute. Regular table cells do not have an attribute to indicate what type they are.

The aid:ccols attribute indicates that the current cell spans the specified number of columns. The default, 1, indicates no column spanning. The aid:crows attribute indicates row spanning.

The aid:trows and aid:tcols attributes specify the number of rows and columns in the table.

The empty aid:theader attribute indicates a heading cell. Footing cells use a similar aid:tfooter attribute. Regular table cells do not have an attribute to indicate what type they are.

The aid:ccols attribute indicates that the current cell spans the specified number of columns. The default, 1, indicates no column spanning. The aid:crows attribute indicates row spanning.

Page 12: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

12 Compiled by: biotics education: www.biotics.in

Biotics Education XML in InDesign Training Jan 2010 12Bioti

cs Education

Understand the Structuring Pane

Structure Pane Icons with It’s Name and Functions

Icon Name UseStructural Element Each document includes only one root element, which can be renamed, but cannotbe

moved or delet ed.Other structural elements are used to organize the elements listed below.

Story Element Represents tagged stories (one or more linked frames).

Text Element Represents XML-tagged text within aframe.

Graphic Element Represents a tagged frame that includes a placed image. Each graphic element includes an “href ” attribute that defines the path or URL to the linked file.

Unplaced Text Element Unplaced text element not yet associatedwitha page item in the document layout.

Unplaced Graphic Element Unplaced graphic element not yet associated with a page item in the document layout.

Table Element Represents a table.

Header Cell Element Represents a cell in the header row of a table.

Body Cell Element Represents a cell within the body of a table.

Footer Cell Element Represents a cell in the footer row of a table.

Empty Element An empty frame is associated with this element.

Attribute Includesmetadata, such as keywords or location of a linked image (HREF attribute). Attributes are meaningful in XML but do not appear in the InDesign document itself.

Comment Includes comments that appear in the XML file, but not the InDesign document.

Processing Instruction Includes an instruction that triggers anaction in applications that can read processing instructions.

Doctype Element Tells InDesign which DTD file to use when validating the XML file.

Page 13: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

Compiled by: biotics education: www.biotics.in 13

Biotics Education XML in InDesign Training Jan 2010 13Bioti

cs Education

To Use The Structure Pane

To Rearrange Elements

Viewing XML tags

Page 14: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

14 Compiled by: biotics education: www.biotics.in

Biotics Education XML in InDesign Training Jan 2010 14Bioti

cs Education

To Show or Hide Tagged Frames or Tag Markers

To Validate XML Structure

A. Loaded DTDB. Error or invalidating conditionC. Description of error with suggested fixD. Error countE. Validate buttonF. View all errors at once in a separate window

Elements appear in the Structure pane (left); markers surround tagged text (right).

Page 15: XML in InDesign - Typesetting India in Indesign.pdfXML in InDesign CS2 Overview 7.1 XML Structure 7.1 Import XML tags 7.2 Apply XML tags 7.3 Mapping tags and styles 7.4 Use the Structure

Typesetting Training for ProfessionalsBiotics

Education

BIOTICS.IN

Thanks

Written and Composed by

Deepak Aggarwal Trainer

K-123, Street No.-11, Sombazar Road, Rajapuri, Uttam Nagar, N.D.- 59 (Opp Dwarka Sec-4) Phone: +91 9899123045 e-Mail: [email protected] website: www.biotics.in