XML technologies / XSLT / Introduction to XSLT 2.0 / XSLT and XPath – round three / Summary and exercises / Test questions
(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 3.)
You should be able to answer these questions without much difficulty. One or more answers are correct in each case. Explained solutions and additional background information are available under Answers to the test questions.
Question 1: For stylesheet modules imported with xsl:import …
a) … the first imported module takes precedence.
b) … the last imported module takes precedence.
c) … both modules have equal precedence.
Question 2: For stylesheet modules included with xsl:include …
a) … the first rule applies in a conflict.
b) … the last rule applies in a conflict.
c) … both rules apply because import precedence does not apply here.
Question 3: What matters for named templates?
a) A template with the called name must exist.
b) The mode attribute cannot be used in the call.
c) The named template must not have a select attribute.
d) A parameter can be passed.
Question 4: A global parameter …
a) … is always declared in a template rule.
b) … has a default value.
c) … can receive a new value while the stylesheet runs.
d) … retains its value throughout the stylesheet’s execution.
Question 5: For two variables with the same name …
a) … the local variable hides the global variable.
b) … the global variable is always visible.
c) … the last declared variable applies.
d) … two local variables cause an error.
Question 6: Which statements about id() and generate-id() are correct?
a) id() can find identifiers declared in the DTD.
b) id() can find identifiers generated by generate-id().
c) generate-id() can generate several identifiers per element.
d) generate-id() always generates the same value for each node.
Question 7: Which statements about keys are correct?
a) Several lists with the same name can exist for key.
b) Several key values can be assigned to one node.
c) A key must be declared in the DTD.
d) A key must be in the main stylesheet.
Copyright © Galileo Press, Bonn 2008
You may print the online version for your private use.
Otherwise, this chapter from “XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn