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
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.1Simple XML document containing a message Welcome to XML! 8
2001 Prentice Hall, Inc. All rights reserved. Fig. 5.2XML document shown in IE5.
2001 Prentice Hall, Inc. All rights reserved. Fig. 5.3Error message for a missing end tag.
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.4XML document that contains Arabic words دايتَل 13 أند &assoc; أهلاً 23 بكم 24 فيِ 25 عالم &text; 29 30
2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.4
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.5XML document that marks up information about a fictitious book Deitel&s XML Primer Paul 13 Deitel Welcome 18 Easy XML 19 XML Elements? 20 Entities
2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.5
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.6XML document that marks up a letter Jane Doe 10 Box Any Ave. 12 Othertown 13 Otherstate Jane Doe Main St Anytown 24 Anystate
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.6XML document that marks up a letter. (Part 2) 30 Dear Sir: 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 The data in an XML element is normalized, so 39 plain-text diagrams such as 40 /---\ 41 | | 42 \---/ 43 will become gibberish Sincerely 46 Ms. Doe 47 48
2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.6
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.7Using a CDATA section // C++ comment 10 if ( this->getX() < 5 && value[ 0 ] != 3 ) 11 cerr << this->displayError(); <![CDATA[ // C++ comment 18 if ( this->getX() < 5 && value[ 0 ] != 3 ) 19 cerr displayError(); 20 ]]> C++ How to Program by Deitel & Deitel 24
2001 Prentice Hall, Inc. All rights reserved. Output for Fig. 5.7
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.8Listing for namespace.xml <directory xmlns:text = "urn:deitel:textInfo" 7 xmlns:image = "urn:deitel:imageInfo"> A book list A funny picture
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.9Using default namespaces <directory xmlns = "urn:deitel:textInfo" 7 xmlns:image = "urn:deitel:imageInfo"> A book list A funny picture
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.10Day planner XML document planner.xml Doctor's appointment 12 Physics class at BH291C Independence Day 17 18
2001 Prentice Hall, Inc. All rights reserved. Outline Fig. 5.10Day planner XML document planner.xml. (Part 2) General Meeting in room 32-A Party at Joe's Financial Meeting in room 14-C
2001 Prentice Hall, Inc. All rights reserved. Fig. 5.11Application that uses the day planner.