![]() Back to www.deitel.com |
In our XML Basics Tutorial, we introduced XML syntax. We also presented an overview of technologies used to parse, validate and format XML documents. In this tutorial, we provide XML markup for an article and for a business letter. We also demonstrate tools for validating XML markup. This tutorial is intended for people who have read our XML Basics Tutorial or who are familiar with basic XML syntax.
Download the examples for this tutorial here.
[Notes: This tutorial is an excerpt (Section 19.3) of Chapter 19, XML, from our textbook Visual C# 2005 How to Program, 2/e (pages 934-940). This tutorial may refer to other chapters or sections of the book that are not included here. Permission Information: Deitel, Harvey M. and Paul J., Visual C# How to Program, 2/E ©2006. Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey.]
1 <?xml version = "1.0"?>
|
3 <!-- Business letter marked up as XML -->
|
4
|
5 <!DOCTYPE letter SYSTEM "letter.dtd">
|
6
|
7 <letter>
|
8 <contact type = "sender">
|
9 <name>Jane Doe</name>
|
10 <address1>Box 12345</address1>
|
11 <address2>15 Any Ave.</address2>
|
12 <city>Othertown</city>
|
13 <state>Otherstate</state>
|
14 <zip>67890</zip>
|
15 <phone>555-4321</phone>
|
16 <flag gender = "F" />
|
17 </contact>
|
18
|
19 <contact type = "receiver">
|
20 <name>John Doe</name>
|
21 <address1>123 Main St.</address1>
|
22 <address2></address2>
|
23 <city>Anytown</city>
|
24 <state>Anystate</state>
|
25 <zip>12345</zip>
|
26 <phone>555-1234</phone>
|
27 <flag gender = "M" />
|
28 </contact>
|
29
|
30 <salutation>Dear Sir:</salutation>
|
31
|
32 <paragraph>It is our privilege to inform you about our new database
|
33 managed with XML. This new system allows you to reduce the
|
34 load on your inventory list server by having the client machine
|
35 perform the work of sorting and filtering the data.
|
36 </paragraph>
|
37
|
38 <paragraph>Please visit our Web site for availability
|
39 and pricing.
|
40 </paragraph>
|
41
|
42 <closing>Sincerely,</closing>
|
43 <signature>Ms. Jane Doe</signature>
|
44 </letter>
|