INSTRUCTOR’S MANUAL
TO ACCOMPANY
40th Anniversary Edition
DATABASE PROCESSING
Fundamentals, Design, and Implementation
15th Edition
Appendix I
XML
David M. Kroenke | David J. Auer | Scott L. Vandenberg | Robert C. Yoder
Appendix I XML
Page I-2
APPENDIX OBJECTIVES
To understand the importance of XML and some of its uses
To understand the role of XSLT in materializing XML documents
ERRATA
There are no known errors at this time. Any errors that are discovered in the future will
Appendix I XML
Page I-3
TEACHING SUGGESTIONS
Students should know that XML is vitally important not just for the products and
technologies in use today, but also because it is the core component of the .Net
initiative. XML Schema will increase in importance over the next few years.
If drawn as shown in the text, the XML Schema text documents have a strict symmetric
indentation pattern because of the paired sets of tags (i.e., <xsd:element> and
</xsd:element>. Point this out to your students as one help for checking whether or not
their work is well-formed. (Just because their work is symmetrical does not mean it is
well-formed, but all well-formed work will demonstrate symmetry). XMLSpy has built-in
checking tools for well-formed structure checking and schema-validity checking.
Appendix I XML
Page I-4
ANSWERS TO REVIEW QUESTIONS
I.1 Why do database processing and document processing need each other?
Database processing needs document processing for transmitting database views; document
I.2 How are HTML, SGML, and XML related?
HTML is a language used to mark up documents for display by Web browsers. HTML is an
I.3 Explain the phrase “standardized but customizable.”
Standardized means always using the same techniques the same way. Customizable means
I.4 What is XML Namespaces? What is its purpose?
XML Namespaces is used to combine different XML Schema vocabularies into the same
I.5 What are the problems in interpreting a tag such as <H2> in HTML?
We cannot rely on tags to indicate the true structure of an HTML page. Tag use is too
I.6 What is a DTD, and what purpose does it serve?
A DTD is a document type declaration. It specifies the name of this type of document and
I.7 What is the difference between a well-formed XML document and a type-valid XML
document?
A type-valid XML document conforms to a DTD or schema. Well-formed XML documents
Appendix I XML
Page I-5
I.8 Why is it too limiting to say that XML is just the next version of HTML?
XML is significantly better than HTML. The designers of XML created a clear separation
I.9 How are XML, XSL, and XSLT related?
XML is the underlying markup language. XSL (Extensible Style Language) is the language
I.10 Explain the use of the pattern {item, action} in the processing of an XSL document.
When the XSLT processor finds an {item, action} pair in an XSL document, it searches for
I.11 What is the purpose of XML Schema?
I.12 How does XML Schema differ from DTD?
XML Schema improves and expands the DTD specification. In particular, XML Schema
I.13 What is a schema-valid document?
An XML document that conforms to an XML Schema is a schema-valid document.
I.14 Explain the chickenand-egg problem concerning the validation of XML Schema
documents.
XML Schemas are validated against other XML Schemas, so the problem is “which XML
Appendix I XML
Page I-6
I.15 Explain the difference between simple and complex elements.
Simple elements have only a single data value, whereas complex elements (referred to as
I.16 Explain the difference between elements and attributes.
Functionally they are very similar, and both are used to identify how data is represented in an
I.17 What is a good basic rule for using elements and attributes to represent database
data?
I.18 Give an example, other than one in this text, of a flat XML Schema.
Solution also available in file DBPe15-IM-App-I-RQ18.xsd.
Appendix I XML
Page I-7
I.19 Give an example, other than one in this text, of a structured XML Schema.
Solution also available in file DBP-e15-IM-App-I-RQ19.xsd.
<?xml version=”1.0″ encoding=”UTF-8″?>
<xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema elementFormDefault=”qualified
attributeFormDefault=”unqualified“>
<xsd:element name=”Student“>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”DormRoom type=”xsd:string“/>
<xsd:element name=”DormPhone type=”xsd:string“/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
I.20 What is the purpose of global elements?
The purpose of global elements is to provide a consistent definition of elements that may be
I.21 What requirement is necessary for processing XML documents with Oracle?
I.22 Explain the difference between FOR XML RAW and FOR XML AUTO, ELEMENTS.
Appendix I XML
Page I-8
I.23 When would you use FOR XML EXPLICIT?
FOR XML EXPLICIT would be used when some data values of the table columns need to be
I.24 What is the importance of the order of tables in a SQL statement that uses FOR
XML?
When the XML document is generated, SQL Server uses the given table order to determine
I.25 Explain, in your own words, why SQL with FOR XML cannot be used to construct an
XML document having two multivalued paths.
SQL itself cannot handle multivalued paths, and the added XML features do not (and cannot)
I.26 Why is the limitation in Review Question I.25 important?
XML Schema can have multivalued paths. Therefore, in order to build the XML Schema, we
I.27 Explain, in your own words, why XML is important to database processing.
XML gives us the ability to combine Web services and database processing so that there is a
I.28 Why is XML Schema important for interorganizational document sharing?
When different organizations that share similar data can agree upon an XML Schema for the
Appendix I XML
I.29 What is XPath?
XPath is the XML standard for addressing elements within documents. XSL expressions
such as
<xsl:value-ofselect=”Customer/CustomerID”>
use the XPath standard for locating elements within a document.
I.30 How does DOM differ from SAX?
SAX and DOM are both methods for parsing XML documents. The SAX parser breaks up
the document so that it can process the document on a structure-by-structure basis, while the
DOM parser processes the entire document at one time. For very large documents, SAX may
therefore be the better choice unless the entire document contents need to be available at the
same time, in which case DOM must be used.
I.31 What is XQuery? What is it used for?
XQuery is the standard (see http://www.w3.org/XML/Query) that allows querying of XML
documents. The author describes it as “SQL for XML documents.” It can be used to
combine databases, documents, Web pages, etc.
I.32 What is SOAP? What did it stand for originally? What does it stand for today?
Page I-13
<Phone>512-974-3344</Phone>
</CUSTOMER>
<CUSTOMER>
<CustomerID>10</CustomerID>
1) Download and install the free Notepad program if you have not done so already.
2) Start Notepad++ and open the HSD XML data document.
3) Ensure that the XML Tools plugin is installed:
5) Select Plugins | XML Tools | Validate now