microsoft ® office word 2003 training introduction to xml in word [your company name] presents:
TRANSCRIPT
Microsoft® Office Word 2003 Training
Introduction to XML in Word
[Your company name] presents:
Introduction to XML in Word
Course contents
• Overview: XML features in Word
• Lesson 1: Why XML?
• Lesson 2: Present XML data in different formats
• Lesson 3: Mark up the data in a Word document with custom XML elements
Each lesson includes a list of suggested tasks and a set of test questions.
Introduction to XML in Word
You may have heard that Word 2003 includes features for working with XML, but maybe you're not sure what that means for your documents or for your business. Why would you use XML? What does Word do with XML?
Overview: XML features in Word
See how Microsoft Office Word 2003 and XML work together to help you reuse data in your Word documents and in other programs.
Introduction to XML in Word
Course goals
• Save a Word document as an XML file.
• See the structure of WordprocessingML, the XML schema that Word uses by default.
• Apply an Extensible Stylesheet Language Transformation (XSLT) to an XML file while opening or saving the file in Word.
(Continued on next slide.)
Introduction to XML in Word
Course goals, cont’d.
• Understand what XML schemas and XSLTs are used for.
• Create a Word template that contains XML elements for entering data.
• Enter data into XML elements in a document.
Lesson 1
Why XML?
Introduction to XML in Word
Why XML?
In many situations, you can benefit from being able to deliver the same information in a variety of ways using XML in Word.
XML source published in many formats
Introduction to XML in Word
Why XML?
For example, a real estate agent creates flyers, updates a Web page, sends e-mail to customers, and submits classified ads to the local newspaper—all for the same list of homes.
XML source published in many formats
Using the power of XML, you can store data in a Word document so that the data is available to be used by a wide variety of software programs.
Introduction to XML in Word
Just the facts, please
When you want to work with information, you're not picky about how it looks. In fact, the plainer the appearance, the easier it is to reuse the same information in many different settings.
When you're working with text, the raw information is called plain text.
Plain text and formatted text
Introduction to XML in Word
When plain text is data
When you save a Word document in XML format, you are actually saving it in plain text.
Any software program that can read plain text can read your XML file.
Plain text used by many software programs
Introduction to XML in Word
What's so special about WordprocessingML?
In a regular Word document, you might use the Heading 1 paragraph style because it makes the text larger and bolder; it makes a line of text stand out visually. As word-processing data, however, headings also indicate the logical structure of a document, like an outline for a paper you wrote in school.
Simplified view of WordML
Introduction to XML in Word
What's so special about WordprocessingML?
WordML provides a way of using plain text to describe the structure, visual appearance, properties, and content of the document. By using plain text to describe the content, properties, visual appearance, and structure of your document, WordML makes all these aspects of your document available for use by any software program that can read plain text.
Simplified view of WordML
Introduction to XML in Word
Suggestions for practice
1. Save a file as XML.
2. See what an XML file from Word looks like:
• Open the .doc file in Notepad.
• Open the .xml file in Notepad.
(Continued on next slide.)
Introduction to XML in Word
Suggestions for practice, cont’d.
3. View the WordML structure in Internet Explorer:
• Open the .xml file in Internet Explorer.
• Expand and collapse levels of the XML structure.
4. Make the round trip:
• Open the XML file in Word.
Online practice (requires Word 2003)
Introduction to XML in Word
Test 1, question 1
What makes the XML file format special? (Pick one answer.)
1. It's the new proprietary file format for Word 2003.
2. It provides a way to format documents.
3. It provides a way to define the contents of a document as structured data separate from how the data is presented.
Introduction to XML in Word
Test 1, question 1: Answer
It provides a way to define the contents of a document as structured data separate from how the data is presented.
The document is a structure of nested elements. Formatting information is self-contained and separate from the data.
Introduction to XML in Word
Test 1, question 2
How do you save a Word document as an XML file? (Pick one answer.)
1. Choose XML Document in the Save as type dialog box.
2. Use a file converter.
3. Just save it as plain text.
Introduction to XML in Word
Test 1, question 2: Answer
Choose XML Document in the Save as type dialog box.
XML is one of the choices for saving files in the Save as type dialog box.
Introduction to XML in Word
Test 1, question 3
Documents saved in XML format are even more versatile than documents saved in Rich Text Format (RTF). (Pick one answer.)
1. True.
2. False.
Introduction to XML in Word
Test 1, question 3: Answer
True.
This statement is true because RTF describes formatting, whereas XML describes data apart from formatting.
Lesson 2
Present XML data in different formats
Introduction to XML in Word
Present XML data in different formats
Extensible Stylesheet Language Transformations (XSLT) present the same XML data in different ways.
XSLT governing display of XML data
In the practice session, upon opening the XML file in Notepad or Internet Explorer, you will see the XML markup. When you open the same file in Word, it will look just like a Word document.
Introduction to XML in Word
Present XML data in different formats
XSLT governing display of XML data
The key to whether you see messy tags or an elegant presentation is literally a process of transformation.This lesson explores Extensible Stylesheet Language Transformations, or XSLTs for short, and how to use them in Word.
Introduction to XML in Word
Now presenting: Information!
If you're a real estate agent, you probably have access to a database of houses for sale. When you get a batch of listings from the database, chances are you see a plain-text report that shows the same kind of information for each house: the number of bedrooms, the number of bathrooms, the year it was built, and so on.
Introduction to XML in Word
Now presenting: Information!
The plain-text report is handy, because the information is structured, like a form. It's also up-to-date because it came straight from the database.
All you have to do to get the newest batch is rerun a query.
Introduction to XML in Word
Now presenting: Information!
Fortunately, if the plain-text data is an XML file, any number of XSLTs, or transforms, can be applied to it so that you can present the information as a flyer, a display ad, a classified ad, an e-mail message, a Web page, or even a text message on a handheld device.
Introduction to XML in Word
Making the transformation
Transforms are written by IT professionals—in your organization or provided by a third party—to present information in a customized manner, similar to the process you might follow for acquiring custom macros or templates that your organization uses.
IT staff creating XSLTs, or transforms
Introduction to XML in Word
Making the transformation
A transform is designed to accommodate the structure of the data it is presenting. For example, a transform that presents the contents of the XML file in Lesson 1 expects the XML file to include a <w:body> element that contains one or more <w:p> elements, and so on.
IT staff creating XSLTs, or transforms
Introduction to XML in Word
Making the transformation
Transforms are also designed to accommodate the final format of the XML data, whether that is a Web page, e-mail message, printed document, or other type of presentation.
IT staff creating XSLTs, or transforms
In this way, transforms are like interpreters that translate raw XML data into its presentation format.
Introduction to XML in Word
Transforms modify documents
The transform may be configured to display only a portion of the data. For example, a real estate flyer does not usually show the name of the owner, so a good real estate transform for a flyer would filter this information out, saving you the step of deleting it manually in Word.
XML data is filtered from the resulting document.
Introduction to XML in Word
Transform while opening
Imagine that you want to use real estate data from an XML source as the basis for a flyer in Word.
If you were to open the XML file directly in Word, you would have a document full of plain text that you would have to format manually.
The Open with Transform command
Introduction to XML in Word
Transform while opening
Now imagine that your clever production staff has devised a transform for this data so that every time you open a real estate XML file in Word, the document already looks like a flyer, with the correct formatting applied.
To specify that Word use a transform to display the XML data, you use the Open with Transform command when you open the XML file.
The Open with Transform command
Introduction to XML in Word
Transform while saving
Applying a transform while opening the XML file lets you work with the transformed version of the file in Word. Alternatively, you can work with the XML data in Word, and then apply a transform when you save the file.
Applying a transform while saving
Introduction to XML in Word
Transform while saving
To apply a transform while you save a file, do the following:
1. Use the XML Document file format.
2. Select the Apply transform check box.
3. Click the Transform button, and then choose the transform you want to apply.
Applying a transform while saving
Introduction to XML in Word
Suggestions for practice
1. Open a raw XML file in Internet Explorer.
2. Apply a transform while opening an XML file in Word:
• Display the data as flyers.
• Display the data as a table.
Online practice (requires Word 2003)
Introduction to XML in Word
Test 2, question 1
Transforms are developed by: (Pick one answer.)
1. Software developers.
2. IT professionals who understand both the XML schema that defines the data and the requirements of the format in which the data will be presented.
3. You.
Introduction to XML in Word
Test 2, question 1: Answer
IT professionals who understand both the XML schema that defines the data and the requirements of the format in which the data will be presented.
Transforms provide a bridge between raw XML data and its presentation, and transform developers need to understand your data as well as how you want to use it.
Introduction to XML in Word
Test 2, question 2
A transform is one way of removing hidden data from Word documents. (Pick one answer.)1. True.
2. False.
Introduction to XML in Word
Test 2, question 2: Answer
True.
A transform that does not process WordML elements, such as DocumentProperties, will omit document properties, such as the author name, when the transformed document is saved in XML format.
Introduction to XML in Word
Test 2, question 3
When you apply a transform, it's a good practice to use the Save As command rather than the Save command because: (Pick one answer.)
1. Word saves the result of the transformation; data that the transform filters out is discarded.
2. XML files should always be saved to the desktop.
3. You may want to troubleshoot the file if something goes wrong with the transformation.
Introduction to XML in Word
Test 2, question 3: Answer
Word saves the result of the transformation; data that the transform filters out is discarded.
Applying a transform is just like editing the file. If you want to preserve the original version, you must save the transformed version to a new file.
Lesson 3
Mark up data with custom XML elements
Introduction to XML in Word
Mark up data with custom XML elements
You know how useful a database can be. Information is stored in a central place, and you can retrieve exactly the information you're interested in.
What's more, a database provides forms for data entry so that everyone adds information to the database in a consistent way.
XML schemas make ordinary documents work like forms.
Introduction to XML in Word
Mark up data with custom XML elements
The blueprint that defines the structure of a database is called a schema.
XML schemas make ordinary documents work like forms.
It's the same with XML data: an XML schema defines the structure of XML data.
Introduction to XML in Word
When documents store data
By attaching an XML schema to a Word document, you enhance an ordinary word-processing document so that the contents of the document can also be stored as XML data.
Introduction to XML in Word
When documents store data
When you attach an XML schema to the template used for creating open-house flyers, anyone who uses that template can automatically store reusable sales points just by creating the flyer in Word.
The XML schema works behind the scenes to identify the data you want to store without requiring the flyer author to know anything about XML.
Introduction to XML in Word
Attach an XML schema to a document
After you have an XML schema that defines the data you want to work with, you add it to the Schema Library.
Schemas in the Schema Library are available to attach to documents and templates in Word.
Introduction to XML in Word
Mark up a document with XML tags
With a schema attached, you can mark up content or even blank fill-in areas of the template with the XML elements that describe the data.
This step is known as tagging the content of the document or template. The tags come from the XML schema that is attached to the document or template.
XML tags in a Word document
Introduction to XML in Word
Distribute the template
When you are finished tagging the content, you can make the template available within your organization for people to use like a form for entering data.
Save a document as a template to make the XML elements available to anyone who creates a document based on that template.
Introduction to XML in Word
Harness the power of XML in Word
When you save your document as an XML file, the data you enter into the document is automatically available to be processed and reused. Yet the document is also the nicely formatted page—suitable for sending in e-mail, printing, or publishing on a Web site—just like any document in Word.
XML data in a Word document is available to other programs.
Introduction to XML in Word
Harness the power of XML in Word
The lessons in this course provide an introduction to XML documents, WordprocessingML, transforms, and XML schemas.
XML data in a Word document is available to other programs.
But the real power of XML technology is the ease with which it makes it possible to automate data processing and word processing—without even running Word.
Introduction to XML in Word
Suggestions for practice
1. View XML tags and XML structure.
2. Prepare the template for distribution.
3. Test your template.
Online practice (requires Word 2003)
Introduction to XML in Word
Test 3, question 1
What is an XML schema? (Pick one answer.)1. A type of Word template.
2. An XML file that defines the data structure of an XML document.
3. A set of rules that govern XML as determined by the World Wide Web Consortium.
Introduction to XML in Word
Test 3, question 1: Answer
An XML file that defines the data structure of an XML document.
An XML schema is like a blueprint for the data that you want to work with.
Introduction to XML in Word
Test 3, question 2
What is WordprocessingML? (Pick one answer.)
1. A proprietary file format owned by Microsoft.
2. WordprocessingML is the only schema that can be used with XML files in Word.
3. WordprocessingML is an XML schema that describes word-processing data.
Introduction to XML in Word
Test 3, question 2: Answer
WordprocessingML is an XML schema that describes word-processing data.
Any XML file that uses WordprocessingML can be rendered as a word-processing document—by Word or by any software that knows how to read XML, such as Microsoft Internet Explorer.
Introduction to XML in Word
Test 3, question 3
When an XML schema is attached to a document, anyone who uses the document needs to understand how to work with XML tags. (Pick one answer.)
1. True.
2. False.
Introduction to XML in Word
Test 3, question 3: Answer
False.
The XML tags can be hidden so that anyone working with the document can work as they normally would. The tagged content is then stored as XML data when the document is saved in the XML format.
Introduction to XML in Word
Quick Reference Card
For a summary of the tasks covered in this course, view the Quick Reference Card.