Exercises: Chapter Two


Problem Solution
Write an XML document which contains your name and address. Open the file in as many Web browsers as you can. Which ones provide meaningful or usable output? Which do nothing useful?
Why does XML require adherence to such a rigorous set of rules to control the structure and form of documents?
XML and HTML share a common ancestor in SGML. HTML documents work in Web browsers even if badly, or incorrectly, formatted. Why don't Web browsers require compliance with the language?
List some of the differences between programming languages such as Pascal, and markup languages such as XML.
XML is a Recommendation of the W3C not an internationally agreed standard. What advantages are there to the W3C approach?
Why must XML tags be properly nested?
XML supports Unicode data. Why is Unicode more suitable for Web applications than ASCII or EBCDIC? How does Unicode solve one of the problems that you might have identified with ASCII?
What are character entities? Try to find a comprehensive list of those which can be used in XML documents.
Enter the XML code for the business letter application. Try loading it into a modern Web browser, does it display properly?
Can you find any ways in which the structure of the business letter might be improved? Make those changes then view you new document in a browser.