Beginning XML Databases (Wrox Beginning Guides)

This appendix contains all the answers to the exercises that appear at the end of each chapter.

Chapter 1

1. 

Which line in this HTML script contains an error?

1. <HTML> 2. <HEAD><TITLE>Title</TITLE></HEAD> 3. <BODY> 4. <P>This is a paragraph. 5. <P>This another paragraph.</P> 6. </BODY></HTML>

  1. 1

  2. 3

  3. 4

  4. 5

  5. None of the above

2. 

How many errors are present in this XML script?

<?xml> <customers> <customer> <name>Zachary Smith</name> <address> <street>1 Smith Street</street> <town>Smithtown</town> <state>NY</state> <zip>11723</zip> </address> <phone>631-445-2231</phone> </customer> <customer> </customers>

3. 

What kind of a web page is this?

<HTML><BODY> <XML ID="xmlParts" SRC="cookies.xml"></XML> <TABLE DATASRC=#xmlCookies> <TR> <TD><DIV DATAFLD="cookietype"></DIV></TD> <TD><DIV DATAFLD="$cookiedescription"></DIV></TD> </TR> </TABLE> </BODY></HTML>

4. 

What does XSL do for XML?

  1. Allows changes to data in XML pages at run-time

  2. Allows changes to metadata in XML pages at run-time

  3. Allows regeneration of entire XML pages at run-time

  4. All of the above

  5. None of the above

Answers

1.  

Exercise 1 solution

e. None of the above. All tags are correct and there are no missing tag delimiters.

2.  

Exercise 2 solution

There are two errors in the XML document. The first error is that the first line, containing the <xml> tag, should look like this:

<?xml version="1.0" ?>

The second error is that the closing </customer> tag is missing from the end of the second customer entry. XML strictly enforces the tag (element) hierarchy.

3.  

Exercise 3 solution

Its an XML data island, embedding an XML data/metadata page directly into an HTML web page script.

4.  

Exercise 4 solution

e. None of the above. XSL is a formatting language that allows application of templates to consistent data repetitions in XML documents. That means that for tags that are duplicated in an XML document, their content can be displayed consistently, when one or more repetitions are displayed in a web page.

Категории