출처 :  http://blog.naver.com/sangsanq/50014598176

 

1.XML Read

XmlReader
-> XmlTextReader, XmlNodeReader, XmlValidatingReader
-> XmlTextReader, FileStream을 통해 XML문서를 로드

XmlNodeReader
-> 스트림 대신 XmlNode를 소스로 사용

XmlValidatingReader
-> XML문서에 대한 유효성 검사
-> XmlTextReader의 모든 기능 포함 + ValidationType, Schemas, SchemaType
-> ValidationType : Auto, DTD, Schema, XDR, None

2.XML Write
XmlWriter
->  XmlTextWriter 를 이용하여 XML 문서 생성

Ex)
XmlTextWriter tw = new XmlTextWriter("파일명",인코딩방식);
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument(); // Xml 문서 시작
tw.WriteStartElement("genre","Mystery");
  .
  .
  .
tw.WriteEndDcoumnet();
tw.Flush();
tw.Close();

3.DOM
-> XmlNode : XML문서의 노드를 나타내는 추상 클래스 XmlNode 클래스를 통해 구현
-> XmlNodeList : XML노드들의 순서화된 리스트
-> 이 두개의 클래스가 .NET 프레임워크의 DOM의 핵심

Ex)
XmlDocument doc = new XmlDocument();
doc.Load("파일경로");
XmlNodeList nl = doc.GetElementByTagName("노드명");
foreach(XmlNode node in nl) MessageBox.show(node.InnerText);

4.XPath
-> XML문서에 대한 빠른 반복문 수행과 데이터 추출을 위해 만들어짐.
XPathDocument : XML문서의 뷰,readony. 문서 Load 4개 오버로드(파일과 경로문자열, TextReader,XmlReader, Stream 기본객체)
XPathNavigator : XPathDocument 탐색
XpathNodeIterator : 노드집합에 대한 반복문 수행
XPathExpression : 검색 식. ex) "/bookstore/book[@genre='novel']"
XPathException
=> XPathNavigator : 생성시 XPathDocument를  IXPathNavigator 인터페이스로 캐스트
=> XPathNodeIterator : 처리할 노드의 서브셋 추출시 모든 Select 메소드들은 XPathNodeIterator 객체 반환
Ex)
XPathDocument doc=new XPathDocument("..\\booksxpath.xml");
XPathNavigator nav=((IXPathNavigable)doc).CreateNavigator();
XPathNodeIterator iter=nav.Select("/bookstore/book[@genre='novel']");
while(iter.MoveNext()) {
  MessageBox.Show(iter.Current);
}

5.XslTransform
=> xsl (스타일시트) 문서 변경시 사용

6.ADO.NET <=> XML

DataBase 자료 => DataSet 클래스의 WriteXml 메소드 이용하여 XML 문서 생성.
  ex ) string file = "c:\test\prod.xml";
   ds.WriteXml(file);
XML => DataSet readXml => DataGrid, ListBox

DiffGram  => 편집 전후의 데이터를 포함하고 있는 XML 문서, 데이터 변경,추가,삭제의 조합도 포함.

6.Serialization
-> 어떤 객체를 구하여 디스크에 저장하는 과정
-> 객체의 public 프로퍼티와  public 필드를 XML의 element, attribute 로 변환 by XmlSerializer
-> Serialize를 통해 특정 객체의 상태를 XML형식의 문서로 변환

Ex)
Products pd = new Products();
pd.property = X; // 프로퍼티 설정
TextWriter tr = new StreamWriter("XML 파일");
XmlSerialize sr = new XmlSerializer(typeof(Object));
sr.Serialize(tr,pd);
tr.Close();

7.Deserialization
-> 직렬화 이전상태로 돌아가는것
-> XML문서를 Deserialize를 통해 Serialize 이전상태의 객체로 환원하는것.
-> Deserialize 을 통해 Xml 문서를 객체를 참조하듯 사용할 수 있음.

Ex)
Products newPd;
FileStream f = new FileStream("XML 파일");
XmlSerializer  newSr = new XmlSerializer(typeof(Products));
newPd = (Products)newSr.Deserializer(f);
listBox1.Items.Add(newPd.ProductName);
f.close();

신고

'Network > XML' 카테고리의 다른 글

XML.net 기본 정리  (0) 2010.07.15
A Guide to XML Import QuarkXTensions Software  (0) 2008.02.20
pdf

A Guide to XML Import

QuarkXTensions Software

?2001 Quark Technology Partnership and Quark, Inc. as to the content and arrangement

of this material. All rights reserved.

?1999?2001 Quark Technology Partnership, Quark, Inc., and their licensors as to the

technology. All rights reserved. U.S. and foreign patents pending.

Information in this document is subject to change without notice and does not represent

a commitment on the part of Quark Technology Partnership or its licensee, Quark, Inc.

Use of the Quark Products is subject to the terms of the end user license agreement or

other applicable agreements for such product/service. In the event of a conflict between

agreements and these provisions the relevant agreements shall control.

Quark Products and materials are subject to the copyright and other intellectual property

protection of the United States and foreign countries. Unauthorized use or reproduction

without Quark’s written consent is prohibited.

Quark, QuarkXPress, QuarkXTensions and QuarkXPress Passport are trademarks of

Quark, Inc. and all applicable affiliated companies, Reg. U.S. Pat. & Tm. Off. and in

many other countries. Avenue.quark and the Quark logo are trademarks of Quark, Inc.

and all applicable affiliated companies.

All other trademarks are the properties of their respective owners.

A Guide to XML Import QuarkXTensions Software

2

Legal Notices

Table of Contents

Introduction 4

Minimum System Requirements 4

Installation Instructions 4

Understanding Placeholders 4

The Placeholders Palette 12

Using Placeholders 15

Placing Content 19

Permanently Replacing Placeholders 22

Exporting Web Documents with Placeholders 22

Contacting Quark 23

A Guide to XML Import QuarkXTensions Software

3

Table of Contents

INTRODUCTION

XML Import QuarkXTensions™ software lets you place content from XML files

in a QuarkXPress™ or QuarkXPress Passport™ document for print, HTML, or

PDF output.

MINIMUM SYSTEM REQUIREMENTS

MAC OS AND WINDOWS

QuarkXPress 4.1 or later

INSTALLATION INSTRUCTIONS

To install XML Import QuarkXTensions software, follow these steps:

FOR MAC OS

1 Quit QuarkXPress or QuarkXPress Passport.

2 Copy the “XML Import” file into the “XTension” folder within your

QuarkXPress or QuarkXPress Passport application folder.

3 Launch QuarkXPress or QuarkXPress Passport to access the features of

XML Import.

FOR WINDOWS

1 Exit QuarkXPress or QuarkXPress Passport.

2 Copy the “XML Import.xnt” file into the “XTension” folder within your

QuarkXPress or QuarkXPress Passport application folder.

3 Launch QuarkXPress or QuarkXPress Passport to access the features of

XML Import.

UNDERSTANDING PLACEHOLDERS

Placeholders let you take content stored in XML format and automatically insert

and format that content in a QuarkXPress document. This vastly simplifies the

process of generating large quantities of QuarkXPress documents that use the

same template.

HOW PLACEHOLDERS WORK

Let’s say you create a weekly newspaper in QuarkXPress, and the newspaper

contains a weekly column listing the top fifty paperback books, including each

book’s title, author name, and publisher name. Each week you receive this

A Guide to XML Import QuarkXTensions Software

4

Introduction

information by e-mail, and you copy and paste it into your magazine, formatting

each title, author name, and publisher name individually. Wouldn’t it be

nice if you could automate this process?

XML Import software lets you do exactly that. Instead of creating the same

column week after week, you can create it once, populate it with formatted

placeholders, and then automatically import the list of books each week.

Before you can understand how placeholders work, you need to understand

how XML and DTDs work.

XML AND DTDS

XML (Extensible Markup Language) is a way of labeling information and

controlling its structure.

LABELING INFORMATION

XML lets you label (or “tag”) information by placing tags on either side of it.

For example, a single book listing in XML might look something like this:

<book>

<title>Stars in the Sky</title>

<author>Galileo Smith</author>

<publisher>Copernicus Press</publisher>

</book>

Note that each part of the book’s description ? the title, the author name, and

the publisher name ? is enclosed within a pair of bracketed <tags>. In effect,

these tags say, “The information between these two points is of this type.”

CONTROLLING STRUCTURE

Note also that the title, author name, and publisher name are all enclosed

between an opening <book> tag and a closing </book> tag. This is an example

of how XML lets you control the structure of information.

A DTD (document type definition) is a sort of blueprint that lets you specify

the structure of an XML document. For our example, a “booklist” DTD might

specify that each <book> element must contain a <title> element, an <author>

element, and a <publisher> element, in that order. It might also define a

<booklist> element, which could contain a number of <book> elements.

A DTD is used as a guideline for creating a particular type of XML file.

For example, the DTD described above could be used to create a number of

XML files, each containing an appropriately tagged title, author name, and

publisher name.

To create DTDs, see A Guide to avenue.quark.

A Guide to XML Import QuarkXTensions Software

5

Understanding Placeholders

∫ If an XML file follows the rules set by a DTD, it is said to be a valid XML file.

ELEMENT PATHS

Every element in an XML file has a path that specifies where it is in the structure

of the XML document. For example, in the following fragment of XML, the path

of the bold <author> element is <booklist> & <book> & <author>.

<booklist>

<book>

<title>Stars in the Sky</title>

<author>Galileo Smith</author>

<publisher>Copernicus Press</publisher>

</book>

</booklist>

PLACEHOLDERS

A placeholder is a token that represents a particular type of element with a

particular element path.

For example, in creating our list of books, you want to be able to automatically

import each book’s title, author name, and publisher name. That means you

need placeholders for each of these elements.

In a DTD, a particular type of information is called an element type. The DTD for

our book list includes element types for <booklist>, <book>, <title>, <author>,

and <publisher>. When you use XML Import QuarkXTensions software to view

this “booklist” DTD, it looks like this:

The DTD from a “booklist” XML file, displayed in the Placeholders palette.

A Guide to XML Import QuarkXTensions Software

6

Understanding Placeholders

To create a placeholder from an element type in this DTD, drag that element

type to a QuarkXPress text box. For example, if you dragged the <title>

element type to a text box, it would look like this:

A placeholder representing the <title> element type.

The word “title” ? corresponding to the <title> element type ? is the placeholder

in this picture. The two gray icons are brackets; for now, all you need to

know is that they display on either side of a placeholder.

Now, what if the DTD you’re using has both <book> elements and <magazine>

elements, and both contain <title> elements? How do you know which kind

of <title> element a placeholder refers to?

To find out, click the Show Markers button in the Placeholders palette.

This button displays labeled gray markers that represent the parent elements

of the placeholder. By looking at the markers in the following screen shot,

for example, you can determine that the path of the <title> placeholder is

<booklist> & <book> & <title>:

A placeholder representing the <title> element type, with markers displayed.

PLACEHOLDERS FOR MULTIPLE ELEMENT TYPES

To create the book list, you need placeholders for each book’s title, author name,

and publisher name. To display the placeholders, drag the whole <book> element

type from the Placeholders palette to the text box. The results look like this

(with markers showing):

Placeholders for the <title>, <author>, and <publisher> element types.

A Guide to XML Import QuarkXTensions Software

7

Understanding Placeholders

Now that you have your placeholders, you can format them. First, you’ll

insert hard returns after the <title>, <author>, and <publisher> placeholders.

Then you can format all three placeholders the way you want to. The results

might look something like this:

Formatted placeholders for the <title>, <author>, and <publisher> element types.

∫ Why are the returns inside the brackets? Anything inside a placeholder’s brackets

is displayed only if there is content to match the placeholder. So if you replace

these placeholders with a <book> element that does not contain a <publisher>

element, neither the <publisher> element nor the return inside its brackets

displays. If you put the return after the <publisher> element’s closing bracket,

that return would display regardless of whether there was content to match

the <publisher> placeholder, and you might end up with a blank line.

Now that you’ve formatted your placeholders, putting an actual book name

into the text box is as easy as clicking a button on the Placeholders palette and

pointing to a well-formed XML file that contains matching <title>, <author>,

and <publisher> elements. Then just click the Toggle Placeholders/Content

button, and XML Import QuarkXTensions software replaces the placeholders

with every instance of corresponding content from the XML file, resulting

in something like this:

XML content that has been placed using the formatted placeholders.

A Guide to XML Import QuarkXTensions Software

8

Understanding Placeholders

∫ A well-formed XML document begins with an XML declaration and has a root

element that contains all of the other elements; each element in the document

is also required to have a corresponding end tag. For information about wellformed

XML documents, see A Guide to avenue.quark.

CONTROLLING PLACEHOLDER ORDER

You can think of placeholders as search parameters that tell XML Import to grab

specific kinds of content from an XML file and put that content in a text box in

a specific order.

In the example you’ve dealt with so far, the set of placeholders tells XML Import

to look for all occurrences of <title>, <author>, and <publisher> elements

nested within <book> elements that are inside <booklist> elements. The <book>

and <booklist> markers are necessary because there might be occurrences

of <title>, <author>, and <publisher> elements in other parts of the DTD,

and you may not want those occurrences.

The example also tells XML Import the order in which to display the <title>,

<author>, and <publisher> elements, but you don’t have to leave them in that

order if you don’t want to. For example, you could place <author> before

<title> and remove <publisher> entirely, simply by moving the placeholder

and markers for <author> (by cutting and pasting) and deleting the placeholder

and markers for <publisher>. The result might look something like this:

Rearranged placeholders for the <author> and <title> element types, with the <publisher>

placeholder removed.

Markers are displayed in the picture above to emphasize the fact that you can

rearrange placeholders only within the branch where they belong. For example,

you can put the <author> placeholder anywhere between the <book> markers,

but you can’t put it between the <booklist> marker and the <book> marker,

because the DTD doesn’t allow <author> elements as direct children of

<booklist> elements.

A Guide to XML Import QuarkXTensions Software

9

Understanding Placeholders

∫ “Parent” and “child” (or “children”) refer to the hierarchical order of the elements.

The parent element always contains the subset of the children elements.

If you want to use sets of placeholders like the one in this example, be sure

to drag the parent element, rather than dragging the child elements over

one at a time. In the above example, you dragged the <book> element type,

which contains the <author> and <title> element types. If you had dragged

the <author> and <title> element types separately, you would have gotten

something like this:

If you drag element types over separately, all matches for each are inserted.

READING MARKERS

One purpose of markers is to show you the path that XML content must have

in order to match a placeholder. Let’s consider a marker based on a DTD that

looks like this in the Placeholders palette:

A sample DTD, viewed in the Placeholders palette.

Let’s say that when you create a placeholder for the <item> element type, it

looks like this:

A Guide to XML Import QuarkXTensions Software

10

Understanding Placeholders

Keeping in mind that markers always come in pairs, you can determine all of

the following from the set of markers shown above:

? Because the placeholders here are X and Y, you know that only <X> or <Y>

elements can match these placeholders.

? The two outermost “root” markers tell us that in order to match one of these

placeholders, an element’s path must begin with <root>.

? The “item” markers tell us that to match one of these placeholders, an element’s

path must begin with <root> and <item>.

? The sets of “A” and “B” markers, joined in the middle by a vertical line, tell us

that to match one of these placeholders, an element’s path must begin with

either <root> and <item> and <A>, or <root> and <item> and <B>. (You can’t

insert text between the closing “A” marker and the opening “B” marker because

the DTD doesn’t allow an <item> element to contain more than one child.)

a When two brackets are merged (represented by this icon: ), it means there

is an OR relationship between the elements on either side. This means an

XML element may contain either what’s on one side of the merged brackets

or what’s on the other. Therefore, it would not make sense to put text between

these two placeholders.

The placeholders inside the “A” markers tell us that to qualify as a match,

an element’s path may be either <root> and <item> and <A>, or <root> and

<item> and <A> and <X>.

The placeholders inside the “B” markers tell us that to qualify as a match,

an element’s path may be either <root> and <item> and <B>, or <root> and

<item> and <B> and <Y>.

So, for example, the following <A> element is a match:

<root>

<item>

<A>Here is some A content.</A>

</item>

</root>

However, this next <A> would not match, because the path to the <A> element

does not include <item>:

<root>

<A>Here is some A content.</A>

</root>

A Guide to XML Import QuarkXTensions Software

11

Understanding Placeholders

a If you’re curious, the actual DTD looks like this. (For information on how to

read a DTD, see A Guide to avenue.quark.)

<!ELEMENT root (item+)>

<!ELEMENT item (A|B)>

<!ELEMENT A (X)>

<!ELEMENT X (#PCDATA)>

<!ELEMENT B (Y)>

<!ELEMENT Y (#PCDATA)>

THE PLACEHOLDERS PALETTE

The Placeholders palette lets you view the DTD from an XML file, drag

placeholders from that DTD into a QuarkXPress document, and populate

the document with content from XML files that adhere to that DTD.

To view the Placeholders palette, choose View & Show Placeholders.

Placeholders palette

SELECT XML OR XMT FILE CONTAINING DTD (BUTTON)

View & Show Placeholders

The Select XML or XMT File Containing DTD button displays the Select

XML or XMT File Containing DTD dialog box, which lets you select an XML

file or avenue.quark template file. The file you choose must include a DOCTYPE

statement and an internal DTD.

A Guide to XML Import QuarkXTensions Software

12

Understanding Placeholders

SHOW MARKERS, HIDE MARKERS (BUTTONS)

View & Show Placeholders

The Show Markers and Hide Markers buttons turn placeholder markers

on and off. Click the Show Markers button if you want to see the full tree

structure of the placeholders in the active QuarkXPress document.

SELECT XML FILE (BUTTON)

View & Show Placeholders

The Select XML File button displays the Select XML File dialog box,

which lets you select an XML file for use with the active QuarkXPress

document’s placeholders.

SELECT XML FOLDER (BUTTON)

View & Show Placeholders

The Select XML Folder button displays the Select XML Folder dialog

box, which lets you select a folder containing XML files. When you click the

Toggle Placeholders/Content button , content from the first XML file in

the folder is placed in the active QuarkXPress document, as indicated by any

placeholders you have created.

PREVIOUS XML FILE (BUTTON)

View & Show Placeholders

The Previous XML File button fills placeholders with content from the

previous XML file in the selected folder.

NEXT XML FILE (BUTTON)

View & Show Placeholders

The Next XML File button fills placeholders with content from the next

XML file in the selected folder.

TOGGLE PLACEHOLDERS/CONTENT (BUTTON)

View & Show Placeholders

The Toggle Placeholders/Content button changes depending on whether

placeholders or XML content are displayed in the active QuarkXPress document.

? If placeholders are displayed, the button fills them with the appropriate content

from the selected XML file.

? If XML content is displayed, the button removes that content and shows

the placeholders.

A Guide to XML Import QuarkXTensions Software

13

The Placeholders Palette

CONVERT PLACEHOLDERS TO TEXT (BUTTON)

View & Show Placeholders

The Convert Placeholders to Text button permanently replaces the

placeholders in the active document with text from the XML file identified in

the File Name field.

FILE NAME (FIELD)

View & Show Placeholders

The File Name field displays the name of the selected XML file. If no XML file

is selected, this field is blank.

File Name field

DTD TREE (LIST)

View & Show Placeholders

The DTD Tree list displays the structure of the selected DTD. You can display

and hide the contents of element types by clicking the > and ? disclosure

triangles (Mac OS) or the and disclosure boxes (Windows). You can

drag element types from the list into a QuarkXPress text box or text path

to create placeholders.

DTD Tree list

∫ If an element in the DTD Tree list is bold, that means it can contain text and

may be dragged to a text box or text path to be used as a placeholder.

A Guide to XML Import QuarkXTensions Software

14

The Placeholders Palette

USING PLACEHOLDERS

XML Import QuarkXTensions software lets you view an XML document’s DTD,

create placeholders from element types in that DTD, format the placeholders,

and place content from XML files in a QuarkXPress text box or text path.

A placeholder is a token that can be replaced by matching content from an

XML file. This section explains how to create, format, and delete placeholders.

CREATING A PLACEHOLDER

Each placeholder corresponds to a particular element type in a DTD. To create

a placeholder:

1 Choose View & Show Placeholders to display the Placeholders palette.

2 Click the Select XML or XMT File Containing DTD button . The Select

XML or XMT File Containing DTD dialog box displays.

The Select XML or XMT File Containing DTD dialog box lets you specify an XML file or

avenue.quark template that contains or references a DTD.

3 Select an XML file or avenue.quark template that uses or references the DTD you

want; click Open. The structure of the DTD, with the root element indicated by

the DOCTYPE statement, displays in the DTD Tree list. Bold element names

indicate element types that may be used as placeholders (that is, placeholders

that may contain text).

The DTD Tree list in the Placeholders palette displays a DTD and lets you create placeholders.

A Guide to XML Import QuarkXTensions Software

15

Using Placeholders

4 With the Content tool E, select a text box or text path in the active

QuarkXPress document.

5 Click the > and ? disclosure triangles (Mac OS) or the and disclosure boxes

(Windows) to display all the element types you want to use as placeholders.

Remember that only bold element types can be used as placeholders.

∫ Child PCDATA and mixed-content elements in a closed (>, ) branch are not

included when you create placeholders.

6 Click and drag the name of an element type from the DTD Tree list to the

text box or text path. When you release the mouse button, the appropriate

placeholders are inserted at the text insertion point i.

This text box contains a placeholder for the <title> element type.

If you want to insert placeholders for a number of element types that are all

members of the same branch of the DTD tree, drag over the element type that

contains the entire branch. If you don’t want all the element types in a branch

to be placeholders, you can delete the placeholders for any element types you

don’t want.

FORMATTING A PLACEHOLDER

A placeholder can be formatted just like regular text. With the Content toolE,

select the placeholder and then format it using the commands in the Style

menu (or their equivalent keyboard commands or buttons).

This placeholder has been formatted to display bold and centered.

A Guide to XML Import QuarkXTensions Software

16

Using Placeholders

SHOWING AND HIDING MARKERS

To show markers, click the Show Markers button . This button displays

labeled gray markers that indicate the path to each placeholder. You can insert

returns and text between most markers.

Placeholders with markers displayed.

To hide markers, click the Hide Markers button .

Placeholders with markers hidden.

ADDING TEXT TO A PLACEHOLDER

You can insert returns, characters, and other text before and after a placeholder.

For example, let’s assume you have a DTD that describes a <body> element type

that may contain one or more <paragraph> elements:

The <body> DTD displayed in the Placeholders palette

If you create a placeholder from the <body> element type, it looks like this

(assuming markers are visible):

These nested placeholder tags indicate that the <body> placeholder has a child element type

called <paragraph>.

A Guide to XML Import QuarkXTensions Software

17

Using Placeholders

If you insert content from an XML document right now, it may not look the

way you expect it to. For example, unless each <paragraph> element contains

its own hard return, all the <paragraph> elements in the <body> element will

run together into one huge paragraph.

A <body> element containing a series of <paragraph> elements without any hard returns

inserted between them.

To solve this sort of problem, you can insert a paragraph return before or after

the <paragraph> placeholder (but still within its brackets). For example, to add

a paragraph return after each <paragraph> element, enter a paragraph return

immediately after the placeholder, like this:

The hard return after the <paragraph> placeholder causes returns to be inserted

after each <paragraph> of content placed from an XML document.

You can also insert characters other than paragraph returns. For example, if you

wanted to add bullets to a list of elements in an XML file, you could add the

bullets to the placeholder, like this:

A bullet and a space before the name of the <paragraph> placeholder, with

a return after the placeholder, turns a series of <paragraph> elements into a

bulleted list.

A Guide to XML Import QuarkXTensions Software

18

Using Placeholders

You can also insert text between two elements. For example, if you wanted

to add a headline above a list of elements in an XML file, you could add the

headline between the parent element’s closing marker and the child element’s

opening bracket, like this:

Text between the <body> marker and the opening bracket of the <paragraph> placeholder is

inserted at the beginning of the bulleted list.

∫ If there is no content in an element, nothing is displayed in place of the

placeholder representing that element; any extra text you’ve inserted inside

the placeholder’s brackets is ignored.

DELETING A PLACEHOLDER

To delete a placeholder from a QuarkXPress text box, select it as you would any

single character and then press Delete (Mac OS) or Backspace (Windows).

PLACING CONTENT

A placeholder indicates where XML content should go and how it should be

formatted. Once you’ve created your placeholders, XML Import makes it easy

to replace them with content from an XML file. Then you can output the

document with the new content in any way you like.

∫ All the tasks in this section assume that you have already created a QuarkXPress

document containing placeholders, and that you have at least one XML file that

includes elements that match the placeholders.

An XML file must be well formed to be used with the XML Import

QuarkXTensions software; however, it does not need to be valid. As long as

at least one element name and path in the XML file matches at least one

element type and path in the DTD, the XML file will work.

A Guide to XML Import QuarkXTensions Software

19

Using Placeholders

PLACING THE CONTENT OF AN XML FILE

To place content from one XML file into the active QuarkXPress document:

1 Choose View & Show Placeholders to display the Placeholders palette.

2 Click the Select XML File button . The Select XML File dialog box displays.

The Select XML File dialog box lets you select an XML file containing content that matches

placeholders in the active QuarkXPress document.

3 Select the XML file you want to use and then click Open. The name of the XML

file displays in the File Name field.

4 Click the Toggle Placeholders/Content button . Content from the XML

file is substituted for the appropriate placeholders in the active QuarkXPress

document. At this point, you can print the document to a printer, print it to

a PostScript file, export its content in a different format, export the document

as a PDF file, or output the document in any other available manner.

5 To remove the placed content and view the placeholders again, click the

Toggle Placeholders/Content button .

PLACING THE CONTENT OF A SERIES OF XML FILES

You may need to place the content of a series of XML documents into the active

QuarkXPress document, one XML file at a time. To place the content of several

XML files in the active QuarkXPress document:

1 Choose View & Show Placeholders to display the Placeholders palette and

verify that the appropriate DTD is displayed. (If the appropriate DTD is not

displayed, see “Using Placeholders” in this document.)

A Guide to XML Import QuarkXTensions Software

20

Placing Content

2 Click the Select XML Folder button . The Select XML Folder dialog

box displays.

The Select XML Folder dialog box lets you indicate a folder containing a series of XML

documents with content that you want to place in the active QuarkXPress document.

3 Navigate to the folder containing the target XML files and then click the Select

button. The name of the first XML file in the folder displays in the File Name

field. If there is more than one XML file in the folder, the Next XML File

button becomes available.

4 Click the Toggle Placeholders/Content button . The content of the indicated

XML file is substituted for the placeholders in the active QuarkXPress document.

At this point, you can print the document to a printer, print it to a PostScript

file, export its content in a different format, export the document as a PDF file,

or output the document in any other available manner.

5 To see the contents of the next XML file in the folder, click the Next XML

File button .

6 To see the contents of the previous XML file in the folder, click the Previous

XML File button .

7 To remove the placed content and see the placeholders again, click the Toggle

Placeholders/Content button .

A Guide to XML Import QuarkXTensions Software

21

Placing Content

PERMANENTLY REPLACING PLACEHOLDERS

When you use placeholders to put XML content into a document, that content

works just like the placeholders. You can select it as a whole, but you can’t select

just part of it. For example, you can italicize all the text in an inserted element,

but you can’t italicize just one word of it.

If you need more precise formatting of placed content, you must make that

content permanent. To permanently replace placeholders with content in

the active QuarkXPress document:

1 If you plan to use the active QuarkXPress document’s placeholders again, choose

File & Save as to save a copy of the document. Once you make content permanent,

you cannot revert it back to placeholders.

2 Choose View & Show Placeholders to display the Placeholders palette.

3 Use the the Select XML File button or the Select XML Folder button to select

the XML file containing the content you want to use. (For more information,

see “Placing Content” in this document.)

4 Click the Toggle Placeholders/Content button if you would like to preview

what the document will look like after the placeholders are replaced.

5 Click the Convert Placeholders to Text button . The text from the XML file

becomes a permanent part of the active document. You can now select, format,

and otherwise edit this text in any way you like.

EXPORTING WEB DOCUMENTS WITH PLACEHOLDERS

If a Web document contains placeholders and you export it as HTML,

(File & Export & HTML), an XSL file is created (instead of an HTML file).

XSL (Extensible Style Language) is a form of XML that is used by XSL

servers to format and style text.

A Guide to XML Import QuarkXTensions Software

22

Permanently Replacing Placeholders

CONTACTING QUARK

IN THE AMERICAS

If you are under a technical support plan or want to purchase a technical support

plan, contact Quark™ Technical Support at 303.894.8899 between the hours

of 7:00 a.m. and 6:00 p.m. Mountain Time. For additional information on technical

support, see the technical support file on your avenue.quark CD-ROM.

For e-mail support of XML Import, send a message to

avenue-user-support@quark.com. For product information and technical

support resources, visit the Quark Web site at www.quark.com.

OUTSIDE THE AMERICAS

If you are under a technical support plan, contact your local Quark Office or

Quark Full Service Distributor.

For a list of Quark Offices and Quark Full Service Distributors, see the technical

support file on your avenue.quark CD-ROM.

For an up-to-date list of Quark offices and Quark Full Service Distributors, click

the “Contact Quark” link on the Quark Web site at www.quark.co.uk.

For product information, visit the Quark Web site at www.quark.co.uk.

For e-mail support of XML Import, send a message to

avenue-user-support@quark.com.

A Guide to XML Import QuarkXTensions Software

23

Contacting Quark

신고

'Network > XML' 카테고리의 다른 글

XML.net 기본 정리  (0) 2010.07.15
A Guide to XML Import QuarkXTensions Software  (0) 2008.02.20

+ Recent posts