XML Test
Sample XML Test
1. To get you started: Place the letter for the best description in front of each term
(place each letter on the right once in front of the best term on the left).
____ XML Schema a. a document validating language not following XML syntax
____ DTD b. a methodology and syntax for generating new markup languages
____ XSLT c. a document translating language that strictly follows XML syntax
____ XML d. a document validating language that strictly follows XML syntax
2. Which of the following changes would you have to make to encode an HTML document according to
the XHTML specification? (circle the letter before all changes to be made)
a. add a <?xml ... ?> directive tag at the beginning of the document in place of the <HTML> tag
b. change each tag and attribute name, if necessary, to be consistent in case use
c. place a quotation mark (") before and after all attribute values that currently lack them
d. add forward slash characters ('/') before the ending > symbol of all img and br tags
e. convert all HTML 2 tags to HTML 4 tags
3. Which of the following are advantages of using XHTML instead of HTML for sharing presentation data over the Web? (circle the letter before each correct answer)
a. XHTML is easier to validate because there is an available XML Schema that automates the process.
b. Human beings can write XHTML much easier than they can write HTML.
c. Applications that use XML documents are easier to write with a strict specification.
d. Languages built upon XML technology contain more specific subject matter than non-XML encodings.
e. XHTML has been available for use in popular Web browsers much longer than HTML
4. Which of the following statements are true regarding DTD and XML-Schema:
(circle the letter before all those that are true statements)
a. Both DTD and XML Schema exist to validate XML documents.
b. XML Schema is a more recent technology than DTD technology.
c. DTD includes native types and grouping elements that XML Schema does not.
d. DTD and XML Schema documents become more valuable as XML languages gain acceptance.
e. XML syntax rules apply to both DTD and XML Schema when determining document validity.
5. Which of the following does an XML Schema document give you that a DTD does not?
(circle the letter in front of all XML Schema benefits)
a. the ability to verify the XML Schema document using the same XML validation techniques as the XML document itself
b. a useful distinction between local and global objects
c. a finer distinction between data types for element content and attribute values
d. the ability to parse (identify the keywords within) the document with standard XML parsing software
e. backward integration with documents written prior to the XML specification
6. XML Schema documents are usually declared externally (in a separate file on a Web server). Which
of the following is the proper way to let an XML processing application know immediately there is
an external XML Schema document available for use? (circle the letter before the one best answer)
a. add a standalone="no" attribute to the opening <?xml directive.
b. add a standalone="yes" attribute to the opening <?xml directive.
c. add a public="no" attribute to the DOCTYPE element
d. add a public="yes" attribute to the DOCTYPE element
e. add a private="no" attribute to the DOCTYPE element
7. Identify the significance of the following DTD element (place a letter from the right in the
blank before the best component on the left):
<!ELEMENT w x | (y, z)>
____ w a. the name of a single element that can be nested inside this element
____ x b. the name of a valid element for the XML document
____ | c. one element name that can be nested inside this element before another required element
____ y d. one element name that can be nested inside this element after another required element
____ , e. the declaration that a choice can be made
____ z f. the identification of the sequencing within the document
g. none of the above
8. Identify the significance of the following DTD element (place a letter from the right in
the blank before the best component on the left):
<!ATTLIST w x CDATA #IMPLIED>
____ w a. declares that the attribute is required
____ x b. declares that the attribute is optional
____ CDATA c. the name of a valid attribute for the XML document
____ #IMPLIED d. the name of a valid element for the XML document
e. declares that any stream of characters can be placed in the attribute value
f. none of the above
9. Which of the following is true of XSLT? (circle the letter before all true answers)
a. One XSLT document is used to convert an XML document into many different types of documents.
b. XSLT processors are embedded in most of the popular Web browsers used to browse Web content.
c. XSLT generates output through the use of templates that connect to elements in an XML document.
d. XSLT includes XSL-FO (for Formatting Objects) technology that is also managed by the W3C
e. XSLT is designed in order to be able to convert HTML documents into XHTML documents
10. Given a future where XML thrives even well beyond today's successes, which of the following make
sense as research directions for XML technology? (circle the letter before all correct answers)
a. Developing database technology where XML documents are stored in their raw XML format.
b. Developing document use analysis technologies that can help suggest proper schemas for XML-based languages.
c. Developing database technology where all Web database interaction is done via XML-based documents.
d. Developing better XML processing technologies that are made freely available to everyone
e. Developing Web services technology where all information passing and service interaction is done via XML-based documents.
11. What is the significance of the following XML Schema and XSLT element names to their related XML document?
(place one letter from the right in the blank before the best element on the left)
____ xsd:choice a. tells the XML document certain elements must be in a certain order
____ xsd:sequence b. processes an XML element there only if it meets a true/false condition
____ xsl:if c. processes a document by looping instructions for a set of elements
____ xsl:for-each d. tells the XML document only one of a set should be used in an element
____ xsd:group e. tells the XML document these elements should be considered together
12. When considering XHTML (or HTML) presentation formatting with tables, which of the following are
true statements (circle the letter before all correct answers):
a. width attributes within td elements tend to define maximum width more so than minimum width.
b. height attributes should never force a change of font size according to the XHTML specification.
c. Tables automatically modify all visual elements equally to meet overall height and width requested.
d. A td element may contain a table element between its and | tags.
e. The ratio attribute can be used to guarantee image resizing to maintain aspect ratio.
13. Which of the following statements are true regarding Uniform Resource Locator (URL) use in Web technologies
such as XML and XHTML? (circle the letter before all correct answers)
a. URLs that begin with a protocol (http://, ftp://, udp:// etc.) specification are all absolute.
b. Relative URLs can identify a parent directory via the use of two periods (..).
c. Relative URLs can identify a child directory via the use of two periods (..).
d. Generally you should always use relative URLs, when possible, for portability.
e. The URL specification allows for the use of forward (/) or backward (\) slashes in valid addresses.
14. Which of the following statements are true regarding XML and related technologies? (circle the letter before all true answers)
a. XHTML can be written with a simple text editor as it discourages word processing meta characters.
b. XSLT allows you to translate multiple XML documents with the same XSLT document.
c. An XML Schema document might refer to another XML Schema document when processing XML.
d. XML documents become more valuable as data is reused in multiple applications.
e. Agreeing on XML tag keywords for an industry with many constituents is often much more difficult than writing an XML Schema document for it.
15. Which of the following zodiac_sign elements could be valid according to the W3C XML 1.0
specification? (circle the letter before all those that are valid (proper))
a. <zodiac_sign type=animal>Leo</zodiac_sign>
b. <zodiac_sign type="animal">Aries</zodiac_sign>
c. <zodiac_sign type=animal name=Taurus/>
d. <zodiac_sign type="inanimate object">Libra</zodiac_sign>
e. <zodiac_sign "life class"="animal">Cancer<zodiac_sign>
16. If you want to guarantee that there are only a limited number of possible values for a leaf
node element (meaning an element without children) to contain in a valid document based on
your markup language, which XML Schema feature can you take advantage of to document the only
valid values (circle the letter before the one best answer):
a. the xsd:enumeration element.
b. the xsd:validlist element
c. the ability to identify valid values in a list within parenthesis
d. the ability to redefine elements of the same name multiple times
e. XML Schema does not provide the ability to guarantee limited valid values within elements
17. Which of the following is true about the relationship between XHTML elements and attributes?
(circle the letter before all true answers)
a. All elements must contain at least one attribute.
b. Attribute names can be reused within tags of different element types.
c. Attributes extend elements to make the element more specific in significance.
d. Elements can contain other elements.
e. Attributes can contain other attributes.
18. Which of the following is the best description of the relationship between HTML and XHTML
(circle the letter before the one best answer):
a. XHTML is a subset of HTML
b. HTML is a subset of XHTML
c. HTML is an XML encoding of XHTML
d. XHTML is an XML encoding of HTML
e. HTML the result of an XSLT application of XHTML
19. Which of the following is the best description of the use of the match attribute within the XSLT
language (circle the letter before the one best answer):
a. Often found in the xsl:stylesheet element, the match attribute identifies which version of the validating schema should be used in the XSLT process.
b. Often found in the xsl:stylesheet element, the match attribute identifies which version of XML is being used when considering the input document in the XSLT process.
c. Often found within xsl:template elements, the match attribute identifies which elements in the source document should be input during this piece of the XSLT process.
d. Often found within xsl:template elements, the match attribute identifies which elements in the target document should be output during this piece of the XSLT process.
e. Often found within XSLT processing directive elements such as xsl:sort or xsl:filter, the match attribute identifies further information in terms of how to match input and output documents.
20. Your turn. Write an XML-related question and answer that shows off your knowledge on the subject (i.e. something not covered by questions in the test above):