Presentation is loading. Please wait.

Presentation is loading. Please wait.

 2001 Prentice Hall, Inc. All rights reserved. Chapter 5 – Creating Markup with XML Outline 5.1Introduction 5.2Introduction to XML Markup 5.3Parsers and.

Similar presentations


Presentation on theme: " 2001 Prentice Hall, Inc. All rights reserved. Chapter 5 – Creating Markup with XML Outline 5.1Introduction 5.2Introduction to XML Markup 5.3Parsers and."— Presentation transcript:

1  2001 Prentice Hall, Inc. All rights reserved. Chapter 5 – Creating Markup with XML Outline 5.1Introduction 5.2Introduction to XML Markup 5.3Parsers and Well-formed XML Documents 5.4Parsing an XML Document with msxml 5.5Characters 5.5.1Character Set 5.5.2Characters vs. Markup 5.5.3While Space, Entity References and Built-in Entities 5.5.4Using Unicode in an XML Document 5.6Markup 5.7 CDATA Sections 5.8XML Namespaces 5.9Case Study: A Day Planner Application 5.10Internet and World Wide Web Resources

2  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.1Simple XML document containing a message. 1 2 3 4 5 6 7 Welcome to XML! 8

3  2001 Prentice Hall, Inc. All rights reserved. Fig. 5.2XML document shown in IE5.

4  2001 Prentice Hall, Inc. All rights reserved. Fig. 5.3Error message for a missing end tag.

5  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.4XML document that contains Arabic words 1 2 3 4 5 6 7 8 9 10 11 12 دايتَل 13 أند 14 15 16 &assoc; 17 18 19 20 21 22 أهلاً 23 بكم 24 فيِ 25 عالم 26 27 28 &text; 29 30

6  2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.4

7  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.5XML document that marks up information about a fictitious book. 1 2 3 4 5 6 7 8 9 Deitel&s XML Primer 10 11 12 Paul 13 Deitel 14 15 16 17 Welcome 18 Easy XML 19 XML Elements? 20 Entities 21 22 23 24

8  2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.5

9  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.6XML document that marks up a letter. 1 2 3 4 5 6 7 8 9 Jane Doe 10 Box 12345 11 15 Any Ave. 12 Othertown 13 Otherstate 14 67890 15 555-4321 16 17 18 19 20 Jane Doe 21 123 Main St. 22 23 Anytown 24 Anystate 25 12345 26 555-1234 27 28 29

10  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.6XML document that marks up a letter. (Part 2) 30 Dear Sir: 31 32 It is our privilege to inform you about our new 33 database managed with XML. This new system 34 allows you to reduce the load on your inventory list 35 server by having the client machine perform the work of 36 sorting and filtering the data. 37 38 The data in an XML element is normalized, so 39 plain-text diagrams such as 40 /---\ 41 | | 42 \---/ 43 will become gibberish. 44 45 Sincerely 46 Ms. Doe 47 48

11  2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.6

12  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.7Using a CDATA section. 1 2 3 4 5 6 7 8 9 // C++ comment 10 if ( this->getX() < 5 && value[ 0 ] != 3 ) 11 cerr << this->displayError(); 12 13 14 15 <![CDATA[ 16 17 // C++ comment 18 if ( this->getX() < 5 && value[ 0 ] != 3 ) 19 cerr displayError(); 20 ]]> 21 22 23 C++ How to Program by Deitel & Deitel 24

13  2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.7

14  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.8Listing for namespace.xml. 1 2 3 4 5 6<directory xmlns:text = "urn:deitel:textInfo" 7 xmlns:image = "urn:deitel:imageInfo"> 8 9 10 A book list 11 12 13 14 A funny picture 15 16 17 18

15  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.9Using default namespaces. 1 2 3 4 5 6<directory xmlns = "urn:deitel:textInfo" 7 xmlns:image = "urn:deitel:imageInfo"> 8 9 10 A book list 11 12 13 14 A funny picture 15 16 17 18

16  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.10Day planner XML document planner.xml. 1 2 3 4 5 6 7 8 9 10 11 Doctor&apos;s appointment 12 Physics class at BH291C 13 14 15 16 Independence Day 17 18

17  2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.10Day planner XML document planner.xml. (Part 2) 19 20 General Meeting in room 32-A 21 22 23 24 Party at Joe&apos;s 25 26 27 28 Financial Meeting in room 14-C 29 30 31 32 33

18  2001 Prentice Hall, Inc. All rights reserved. Fig. 5.11Application that uses the day planner.


Download ppt " 2001 Prentice Hall, Inc. All rights reserved. Chapter 5 – Creating Markup with XML Outline 5.1Introduction 5.2Introduction to XML Markup 5.3Parsers and."

Similar presentations


Ads by Google