Section 3.1 Extended Markup Language (XML)
Learning Objectives
After you have completed this section, you should be able to
- define XML.
- explain why it has been developed.
- explain some basic terminologies of XML.
- define DTDs and Schemas.
- write a DTD or schema for a given XML-based markup language.
- describe some XML-based markup languages such as MathML and XML.
- define the Document Object Model (DOM) and where it should be used.
- explain how XML documents are parsed and used in a website.
- write and use XSL and XSLT for website development.
Activities
Study Questions
- What is XML? For what purpose was it developed?
- What are the main features of XML compared to HTML?
- Is XML case sensitive?
- What should an XML document start with?
- Should every start tag have a matching end tag?
- Should every attribute value be enclosed in either double quotes or single quotes?
- Are XML tags allowed to overlap one another?
- What is a root element of an XML document?
- What are XML namespaces? Why are namespaces used in XML documents?
- How do you introduce a namespace and use it in an XML document?
- If you have written an XML document, how do you check whether it is valid or not?
- What are data type definitions?
- How are DTDs used?
- How does a DTD help an XML parser to verify that an XML document is valid?
- What does an ELEMENT element type define in a DTD?
- What does an ATTLIST element type define in a DTD?
- How do you specify child elements for an element in a DTD?
- Can you specify the data type of an element or attribute in a DTD?
- What do the keywords #IMPLIED, #REQUIRED, #FIXED, EMPTY specify?
- What data do CDATA and #PCDATA refer to?
- What is XML Schema? What led to the development of schemas?
- What are the differences between DTD and Schema?
- What are the main advantages of XML Schema over DTDs?
- What namespace do XML Schema documents use?
- What markup tags are provided to write XML schemas?
- Can you specify what type of data an element or attribute may take? How do you do that?
- What is MathML?
- What markup tags are provided to describe mathematical notions and expressions?
- What other markup language derived from XML is interesting to you?
- What is the Document Object Model (DOM)?
- What are DOM-based XML parsers?
- What does a DOM-based XML parser generate?
- What are root nodes, parent nodes, sibling nodes, and child nodes in a DOM tree?
- What can you do with the nodes in a DOM tree?
- What properties are associated with each node in a DOM tree?
- How do you describe the relationships between DTDs, XML Schema, XML parsers, and DOMs?
- What methods are associated with each node in a DOM tree?
- What are the advantages and disadvantages of DOM-based XML parsers?
- What is the simple API for XML (SAX)?
- What are the differences between DOM-based parsers and SAX-based parsers?
- What does a SAX-based XML parser generate?
- What are the advantages and disadvantages of SAX-based parsers?
- What is the Extensible Stylesheet Language (XSL)?
- What does an XSL document specify?
- What is the relationship between XML and XSL?
- What is XSLT?
- What are source trees and result trees in XSLT?
- How do you refer to an XSL style sheet within an XML document?
- How do you use an XSL style sheet to transform each element or attribute of an XML document?
- What are templates in XSL style sheets? What does each template describe?
Review
Do the self-review exercises for Chapter 15.
Summary
Read the Chapter 15 summary.