24
Advanced Advanced Technical Technical Writing Writing 2006 2006 Session #4

Advanced Technical Writing 2006 Session #4. Today in Class… ► Meet with your editorial team, refine/post deliverables ► Send URL for deliverables to Bill

Embed Size (px)

Citation preview

Advanced Advanced Technical Technical WritingWriting

20062006

Session #4

Today in Class…Today in Class…

►Meet with your editorial team, Meet with your editorial team, refine/post deliverablesrefine/post deliverables

►Send URL for deliverables to Send URL for deliverables to Bill to post on class pageBill to post on class page

►Brief intro to XMLBrief intro to XML

A brief introduction to XMLA brief introduction to XML

As customized as necessary

&

As generalized as possible

What is XMLWhat is XML

►eeXXtensible tensible MMarkup arkup LLanguage anguage ((muchmuch cooler than eML, eh?)cooler than eML, eh?)

►Think of it as a generic way to Think of it as a generic way to describe markup languages…describe markup languages…allowing users to create their own allowing users to create their own tags which describe what is tags which describe what is sometimes called the “semantic sometimes called the “semantic structure” of a documentstructure” of a document

What is XMLWhat is XML

►Still confused? XML is a subset of Still confused? XML is a subset of SGML, the publishing industry SGML, the publishing industry standard for describing content so standard for describing content so that it can be stored, referenced, that it can be stored, referenced, distributed, and presented distributed, and presented consistently across diverse consistently across diverse systemssystems

This is XML*This is XML*

<?xml version="1.0"?><?xml version="1.0"?><citation><citation>

<author>Hart-Davidson, <author>Hart-Davidson, William</author>William</author><date>2000</date><date>2000</date><publisher><publisher>

<pname>Drybooks Inc.</pname><pname>Drybooks Inc.</pname><pcity>Antwerp</pcity><pcity>Antwerp</pcity>

</publisher></publisher></citation></citation> * Well formed, but not valid

XML…

This couldbe finergrained..

What does XML do? 1What does XML do? 1

XML allows you to define the XML allows you to define the pieces of information (or pieces of information (or objects, as we came to know objects, as we came to know them this week) that make up them this week) that make up a document in such a way as to a document in such a way as to allow both humans and allow both humans and machines to recognize them machines to recognize them and act upon themand act upon them

What does XML do? 2What does XML do? 2

For machines, XML defines the logical For machines, XML defines the logical structure of the document, giving structure of the document, giving names to things so they can be names to things so they can be recognized (parsed) or referenced in recognized (parsed) or referenced in conditional statements, etcconditional statements, etc

……for people, it provides a way to for people, it provides a way to describe what I’d rather call the describe what I’d rather call the rhetorical structure of the documentrhetorical structure of the document

How does XML work?How does XML work?

xml

Dtd

stylerules

An xml document is made valid when a Document Type Definition (or Schema) is present that describes types of elements and the relationships among elements for the document

An XML scenario, 1An XML scenario, 1

Bill downloads a DTD that describes citation lists according to the Chicago Manual of Style

Chicago

dtd

Using a program that exports citation listings in XML, he enters info for lots of books..each is stored as an XML file

An XML scenario, 1An XML scenario, 1

Bill creates a CSS document that describes how Chicago Style references lists look

Chicago css

Bill watches as the browser builds his reference list

He could have also used XSLT…

An XML scenario, day 2An XML scenario, day 2

Bill downloads a new DTD, this one for MLA style citations, and a new style sheet too!

Bill’s editor wants the same list in MLA format!

A bit more about DTDsA bit more about DTDs

DTDs are the place where XML DTDs are the place where XML tag sets are defined. They are tag sets are defined. They are pretty powerful meta-pretty powerful meta-documents that determine documents that determine what the folks reading and what the folks reading and writing XML documents of a writing XML documents of a particular type can and cannot particular type can and cannot include, search for, etc.include, search for, etc.

A bit more about DTDsA bit more about DTDs

We can consider DTD’s, or their newer We can consider DTD’s, or their newer and more flexible counterparts called and more flexible counterparts called XML Schema, as workspaces. They XML Schema, as workspaces. They define conceptual and physical define conceptual and physical boundaries for content developersboundaries for content developers

Their design is a critical task for the Their design is a critical task for the content specialist. Well wrought DTD’s content specialist. Well wrought DTD’s & Schema can greatly impact the both & Schema can greatly impact the both user experience, the development user experience, the development cycle, and, hence, the cycle, and, hence, the business/mission.business/mission.

Let’s Do a Little XML Let’s Do a Little XML exerciseexercise

Think of a document type that has sufficiently Think of a document type that has sufficiently granular content as to make it pretty simple granular content as to make it pretty simple to come up with some XML tags to describe to come up with some XML tags to describe it.it.

► Make up a quick list of the tags that you Make up a quick list of the tags that you think you would need.think you would need.

► Name your tags with semantic labels…that Name your tags with semantic labels…that is, identify functional objects within the is, identify functional objects within the document…avoid using “structural” units document…avoid using “structural” units like “paragraph”like “paragraph”

Inside the DTD…Inside the DTD…

A DTD is just a list of declarations. Let’s A DTD is just a list of declarations. Let’s consider three common types :consider three common types :

1.1. The first declaration names the The first declaration names the DOCTYPE. DOCTYPE.

<!DOCTYPE document_name […the rest of the dtd here]>

Inside the DTD, 2Inside the DTD, 2

2. Then come declarations of 2. Then come declarations of document ELEMENTs. document ELEMENTs.

<!ELEMENT element_name (#data_type)>

Inside the DTD, 3Inside the DTD, 3

3. Finally, there may be declarations 3. Finally, there may be declarations for ATTRIBUTES of an ELEMENT.for ATTRIBUTES of an ELEMENT.

<!ATTLIST parent_element attribute_name data_type #default_value>

This is a DTDThis is a DTD

<!DOCTYPE citation [<!ELEMENT book (author, date, publisher)><!ELEMENT author (#PCDATA)><!ELEMENT date (#PCDATA)><!ELEMENT publisher (#PCDATA)>

<!ATTLIST publisher pname CDATA #REQUIRED><!ATTLIST publisher pcity CDATA #REQUIRED>

]>

1. Find a movie review. 1. Find a movie review.

2. Pick out the “objects” and create markup 2. Pick out the “objects” and create markup by by - using CSS to color code your news story - using CSS to color code your news story with <span> and a background color; with <span> and a background color; each color should correspond to an item each color should correspond to an item on the DTDon the DTD- - pasting the text into MS Word and using pasting the text into MS Word and using the “highlighter” tool to apply colorsthe “highlighter” tool to apply colors

3. Provide a key so we can see what your 3. Provide a key so we can see what your objects areobjects are

Another X-ercise…we’ll Another X-ercise…we’ll review these next time!review these next time!

A Few More X’s…A Few More X’s…

►What is XHTML?What is XHTML?

Quite simply, it is html Quite simply, it is html redescribed as an XML DTD. Or redescribed as an XML DTD. Or another way to say it is that another way to say it is that XHTML is the current default web XHTML is the current default web DTD. The W3C may stop issuing DTD. The W3C may stop issuing HTML spec. in the future and just HTML spec. in the future and just describe a baseline web DTD or describe a baseline web DTD or Schema.Schema.

A Few More X’s…A Few More X’s…

► What is XSL? XSL-T?What is XSL? XSL-T?

The xml stylesheet specification. The xml stylesheet specification. XSLT is a very robust spec for XSLT is a very robust spec for transforming an XML document of transforming an XML document of one type into one of another type…one type into one of another type…meaning you can do more than just meaning you can do more than just “style” information for display, you “style” information for display, you can also change it into other forms.can also change it into other forms.

Good references for Good references for CSS & XMLCSS & XML

www.webmonkey.comwww.webmonkey.com

www.xml.comwww.xml.com

www.w3c.orgwww.w3c.org

Next Time…Next Time…

►Semantic Markup 2 - XML, Semantic Markup 2 - XML, dynamic presentation, & dynamic presentation, & multiple audience adaptationmultiple audience adaptation

►Read: Wright (pdf); Williams & Read: Wright (pdf); Williams & Spyridakis (pdf)Spyridakis (pdf)

►Post your XML color-coding Post your XML color-coding exerciseexercise