Professional Documents
Culture Documents
New Perspectives On XML Comprehensive 3Rd Edition Carey Test Bank Full Chapter PDF
New Perspectives On XML Comprehensive 3Rd Edition Carey Test Bank Full Chapter PDF
3. The identity template matches any kind of node in the source document and copies them to the result document.
a. True
b. False
ANSWER: True
REFERENCES: XML 332
4. The copy-of element is similar to the copy element, as both create a deep copy of a node set.
a. True
b. False
ANSWER: False
REFERENCES: XML 333
5. If XPath is unable to calculate a value because of an error in the style sheet, it will return the text string "NaN" (Not a
Number).
a. True
b. False
ANSWER: True
REFERENCES: XML 347
6. XSLT and XPath 1.0 support three data types for numbers.
a. True
b. False
ANSWER: False
REFERENCES: XML 351
7. The normalize-space() function can also be used to remove extraneous white space characters from the
beginning or end of any text string.
a. True
b. False
ANSWER: True
REFERENCES: XML 360
8. The only element that the call-template element can contain is the with-param element.
Cengage Learning Testing, Powered by Cognero Page 1
Name: Class: Date:
a. True
b. False
ANSWER: True
REFERENCES: XML 369
9. To operate recursively, a function must call itself employing the base case.
a. True
b. False
ANSWER: False
REFERENCES: XML 371
10. Named templates can be used to store variable values by having the last action of the template use the value-of
element to set the variable value.
a. True
b. False
ANSWER: True
REFERENCES: XML 377
11. Variables are accessed using the reference @name where name is the variable name.
ANSWER: False - $name
REFERENCES: XML 324
12. XSLT variables act more like constants because the value of an XSLT variable can only be defined once and it cannot
be further updated.
ANSWER: True
REFERENCES: XML 327
13. The copy element creates a(n) deep copy of the active node.
ANSWER: False - shallow
REFERENCES: XML 332
14. The copy element under XSLT 2.0 also supports the inherit-namespace attribute.
ANSWER: True
REFERENCES: XML 335
15. If you place the include element at the beginning of your style sheet it will have precedence over the active style sheet.
ANSWER: False - end, bottom
REFERENCES: XML 339
16. The XPath 1.0 numeric function ceiling(number) rounds number up to the next integer.
ANSWER: True
REFERENCES: XML 347
17. In general, you should use the number() function for numbering the nodes in the result document.
ANSWER: False - position(), position
Cengage Learning Testing, Powered by Cognero Page 2
Name: Class: Date:
18. XSLT and XPath 1.0 support only one data type for numbers—double precision floating point.
ANSWER: True
REFERENCES: XML 351
19. Do not use the entity to generate white space, even if you are generating HTML code, because that entity
will not be recognized by the XSLT processor.
ANSWER: True
REFERENCES: XML 360
20. A(n) recursive template is a template that is not matched to a node set but instead acts like a function to display a
calculated value or perform an operation.
ANSWER: False - named
REFERENCES: XML 360
21. The _____ element includes the contents of an external style sheet file in the current style sheet.
a. xsl:include b. xsl:variable
c. xsl:import d. xsl:concatenate
ANSWER: a
REFERENCES: XML 324
23. Variables that contain text strings should enclose those text strings within a separate set of _____.
a. parentheses b. quotation marks
c. angle brackets d. square brackets
ANSWER: b
REFERENCES: XML 329
24. If the expression is a number or Boolean value, the _____ element converts the expression to a text string and the text
is output to the result document.
a. export b. concatenate
c. copy-of d. deep-copy
ANSWER: c
REFERENCES: XML 333
25. If you only want to copy the descendent elements and attributes of the summary element but not the summary element
itself, use the wildcard character (_____) in the copy-of element structure.
a. @ b. %
c. & d. *
Cengage Learning Testing, Powered by Cognero Page 3
Name: Class: Date:
ANSWER: d
REFERENCES: XML 333
26. One way of accessing data from multiple source documents within an XSLT style sheet is by using the _____ doc()
function.
a. XPath 2.0 b. XSLT 1.0
c. XSLT 2.0 d. XPath 1.0
ANSWER: a
REFERENCES: XML 335
27. One way of accessing data from multiple source documents within an XSLT style sheet is by using the _____
unparsed-text() function.
a. XPath 2.0 b. XSLT 1.0
c. XSLT 2.0 d. XPath 1.0
ANSWER: c
REFERENCES: XML 335
28. When using the document() function, you must enter the URI for a path on the local machine prefaced with _____,
and any spaces or special characters must be replaced with escape codes.
a. file:/// b. file:
c. uri:// d. file:\\
ANSWER: a
REFERENCES: XML 336
29. Many editors, including the Firefox browser, do not support the _____ attribute and will instead display the text of the
file, including the HTML markup tags.
a. indent b. disable-output-escaping
c. disable-unparsed-text d. enable-parsed-text
ANSWER: b
REFERENCES: XML 338
30. The _____ function will return a value of true if the document exists and is well-formed.
a. unparsed-text-available() b. text-available()
c. doc-text-available() d. doc-available()
ANSWER: d
REFERENCES: XML 338
31. If you are concerned about name conflicts and want the active style sheet to always have precedence over the external
sheet, always use the _____ element.
a. import b. include
c. copy d. priority
ANSWER: a
REFERENCES: XML 339
32. One way to create a lookup table is to use the _____ function, which returns the active node being processed in the
Cengage Learning Testing, Powered by Cognero Page 4
Name: Class: Date:
33. The XPath 1.0 numeric function _____ counts the number of items in values.
a. number(values) b. sum(values)
c. count(values) d. ceiling(values)
ANSWER: c
REFERENCES: XML 347
34. The XPath 1.0 numeric function _____ rounds number up to the next integer.
a. ceiling(number) b. floor(number)
c. top(number) d. round(number)
ANSWER: a
REFERENCES: XML 347
35. The number format symbol _____ is a placeholder that displays an optional number of digits in the formatted number
and is usually used as the far left symbol in the number format.
a. 0 b. %
c. # d. .
ANSWER: c
REFERENCES: XML 352
36. The number format symbol _____ is a placeholder that displays required digits in the formatted number.
a. # b. %
c. 0 d. .
ANSWER: c
REFERENCES: XML 352
37. The number format symbol _____ separates the pattern for positive numbers from the pattern for negative numbers.
a. ; b. #
c. , d. .
ANSWER: a
REFERENCES: XML 352
38. The number format symbol _____ separates groups of digits in the number.
a. ; b. #
c. . d. ,
ANSWER: d
REFERENCES: XML 352
39. The number format symbol _____ separates the integer digits from the fractional digits.
a. . b. ;
c. , d. #
ANSWER: a
REFERENCES: XML 352
40. The expression format-number(-238.2, '#,##0.0;(#,##0.0)') displays the value –238.2 as _____.
a. (238.20) b. -238.2
c. (238.2) d. -238.20
ANSWER: c
REFERENCES: XML 352
41. The _____ attribute of the decimal-format element represents the character used to represent negative values.
a. minus-sign b. NaN
c. zero-digit d. pattern-separator
ANSWER: a
REFERENCES: XML 353
42. The _____ attribute of the decimal-format element represents text used to represent entries that are not numbers.
a. minus-sign b. zero-digit
c. pattern-separator d. NaN
ANSWER: d
REFERENCES: XML 353
43. The _____ attribute of the decimal-format element represents the character used to separate the integer and
fractional parts of the number.
a. decimal-separator b. grouping-separator
c. pattern-separator d. digit
ANSWER: a
REFERENCES: XML 353
44. Many of the XPath functions work with sections of text strings called _____.
a. pseudostrings b. superstrings
c. substrings d. instrings
ANSWER: c
REFERENCES: XML 355
45. White space nodes are nodes that contain only white space characters such as _____.
a. blanks b. line returns
c. tabs d. All of these are correct.
ANSWER: d
REFERENCES: XML 360
46. If you want to insure that white space nodes are not deleted, you can apply the _____ element as a direct child of the
stylesheet element.
a. maintain-space b. preserve-space
c. normalize-space d. hold-space
ANSWER: b
REFERENCES: XML 360
47. Parameters created in XSLT 2.0 also support the _____ attribute to define the data type of the parameter value.
a. as b. data-type
c. type d. in
ANSWER: a
REFERENCES: XML 364
48. To set the value of a template parameter, use the _____ element.
a. param b. with-param
c. set-param d. as-param
ANSWER: b
REFERENCES: XML 368
49. A(n) _____ template is a template that is not matched to a node set but instead acts like a function to display a
calculated value or perform an operation.
a. unmatched b. function
c. named d. operator
ANSWER: c
REFERENCES: XML 368
50. _____ programming relies on the evaluation of functions and expressions, rather than on the sequential execution of
commands.
a. Functional b. Procedural
c. Recursive d. Object-oriented
ANSWER: a
REFERENCES: XML 369
52. Which of the following shows the correct result of the substring function: substring("Harpe Gaming
Store", 7, 6)?
a. "Gaming" b. "g Store"
c. "Harpe G" d. " Store"
ANSWER: a
REFERENCES: XML 355
53. Which of the following shows the correct result of the substring-before function: substring-
Cengage Learning Testing, Powered by Cognero Page 7
Name: Class: Date:
54. Which of the following shows the correct result of the substring-after function: substring-
after("2017-10-05", "-")?
a. "-" b. "05"
c. "10-05" d. "-10"
ANSWER: c
REFERENCES: XML 356
55. Which of the following shows the correct result of the nested substring functions: substring-
before(substring-after("2017-10-05", "-"), "-")?
a. "-" b. "05"
c. "2017" d. "10"
ANSWER: d
REFERENCES: XML 356
56. Which of the following shows the correct result of the concat function: concat("October ", "10, ",
"2017")?
a. "October 10, 2017" b. "October10,2017"
c. "October" d. "October 10,2017"
ANSWER: a
REFERENCES: XML 356
57. Which of the following shows the correct syntax of the function supported by XSLT 2.0 to retrieve non-XML data?
a. unparsed-text(uri [,encoding]) b. parsed-text(uri [,encoding])
c. unparsed-text(encoding [,uri]) d. parsed-text(encoding [,uri])
ANSWER: a
REFERENCES: XML 338
58. Which of the following shows the correct syntax of the function used to test for the existence of an XML document?
a. exists(uri) b. doc-available(uri)
c. doc-exists(uri) d. available(uri)
ANSWER: b
REFERENCES: XML 338
59. Which of the following shows the correct syntax of the element used to include an external style sheet in the active
style sheet?
a. <xsl:include uri="href" /> b. <xsl:include doc="uri" />
c. <xsl:include href="uri" /> d. <xsl:include uri="doc" />
ANSWER: c
60. Which of the following shows the correct syntax of the element used to import an external style sheet in the active
style sheet?
a. <xsl:import href="uri" /> b. <xsl:import uri="href" />
c. <xsl:import doc="uri" /> d. <xsl:import uri="doc" />
ANSWER: a
REFERENCES: XML 339
61. Which of the following expressions can be used to display the value of the active node?
a. <xsl:value-of select="uri" /> b. <xsl:value-of select="active()" />
c. <xsl:value-of select="*" /> d. <xsl:value-of select="." />
ANSWER: d
REFERENCES: XML 344
62. Which of the following if elements tests whether the context node is in the third position in the result document?
a. <xsl:if test="position()=3" /> b. <xsl:test if="position()=3" />
c. <xsl:if test="position(3)" /> d. <xsl:test if="position(3)" />
ANSWER: a
REFERENCES: XML 348
George is developing an XSLT style sheet to display data from research surveys. The structure of the surveys.xml file is
shown in the accompanying figure. He comes to you for assistance in preparing the final file.
63. The source document contains data for thousands of surveys. George would like to display information for only the
first six surveys. Which of the following shows the correct syntax for the predicate George should use to insure only the
first six surveys are displayed?
a. [position() <= 5] b. [position() = 5]
c. [position() <= 5] d. [position() < 6]
Cengage Learning Testing, Powered by Cognero Page 9
Name: Class: Date:
ANSWER: a
REFERENCES: XML 348
64. George knows that the position() function returns the position of the node as it is displayed within the result
document, not necessarily the position of the node in the source document. Which element do you suggest George use to
retrieve the position values of the nodes as they appeared in the source document?
a. location b. number
c. source-position d. source-value
ANSWER: b
REFERENCES: XML 349
65. One of George's research associates has created a style sheet named surveyfunctions.xsl containing functions that will
be used in displaying the survey data. Which of the following shows the correct code George should enter in his new style
sheet to allow him to use the functions in the surveyfunctions.xsl file?
a. <xsl:include uri="surveyfunctions.xsl" />
b. <xsl:apply-templates select="surveyfunctions.xsl" />
c. <xsl:include href="surveyfunctions.xsl" />
d. <xsl:copy-of select="surveyfunctions.xsl" />
ANSWER: c
REFERENCES: XML 358
66. The response attribute of the question element in George's surveys.xml file can contain paragraphs of text. Which of
the following shows the code George could use to insure any white space in the response does not get stripped out when
the final file is displayed?
a. <xsl:preserve-space elements="*" />
b. <xsl:normalize-space elements="*" />
c. <xsl:maintain-space elements="*" />
d. <xsl:preserve-space select="*" />
ANSWER: a
REFERENCES: XML 360
67. George was able to successfully access the functions in the surveyfunctions.xsl file from his new style sheet.
However, he is having difficulty getting the functions to work. In looking over his code, you remind him that a function in
a named template has to be _____ to be used.
a. called b. applied
c. implemented d. inserted
ANSWER: a
REFERENCES: XML 369
Helena is studying functional programming, using the drawImages template shown in the accompanying figure as an
example. She comes to you for help in learning the key features of functional programming.
68. Helena has heard that every recursive function contains a base case that represents a stopping condition. In the
drawImages template, you explain to her that the function would reach the base case when _____.
a. $imgCount < 0 b. $imgCount = 0
c. $imgCount - 1 > 0 d. $imgCount = ""
ANSWER: b
REFERENCES: XML 371
69. Helena has heard that every recursive function contains a change of state that occurs when the base case has not been
reached. In the drawImages template, you explain to her that the change of state is represented by the code _____.
a. <xsl:if test="$imgCount > 0">
b. <xsl:with-param name="imgFile" select="$imgFile" />
c. <img src="{$imgFile}" alt="" />
d. <xsl:with-param name="imgCount" select="$imgCount - 1" />
ANSWER: d
REFERENCES: XML 371
70. Helena has heard that every recursive function function must call itself employing the change of state. In the
drawImages template, you explain to her that this call is represented by the code _____.
a. <xsl:call-template name="drawImages">
b. <xsl:with-param name="imgFile" select="$imgFile" />
c. <xsl:if test="$imgCount > 0">
d. <xsl:template name="drawImages">
ANSWER: a
REFERENCES: XML 371
71. Helena would like to insert a blank space in the result document after the drawImages template runs. You tell her she
can do this using the code _____.
a. <xsl:text> </xsl:text> b. <xsl:text></xsl:text>
72. Helena has heard that it is possible to use a named template to store a variable value. You tell her she can do this
having the last action of the template use the _____ element to set the variable value.
a. name b. with-param
c. value-of d. select
ANSWER: c
REFERENCES: XML 377
73. A(n) _____ is a collection of data values that can be searched in order to return data that matches a supplied key value.
ANSWER: lookup table
REFERENCES: XML 344
74. Many of the XPath functions work with sections of text strings called _____.
ANSWER: substrings
REFERENCES: XML 355
75. Some XSLT processors strip _____ nodes, which are nodes that contain only white space characters such as blanks,
line returns, or tabs.
ANSWER: white space
REFERENCES: XML 360
76. The _____ function is an XSLT 1.0 function used to access the contents of an external XML file.
ANSWER: document()
REFERENCES: XML 324
77. The _____ element includes the contents of an external style sheet file in the current style sheet.
ANSWER: xsl:include
REFERENCES: XML 324
78. The _____ element creates a variable as a user-defined name that stores a value or an object.
ANSWER: xsl:variable
REFERENCES: XML 324
79. One approach to including markup tags as part of an element’s value is to place the HTML code within a(n) _____
section.
ANSWER: CDATA
REFERENCES: XML 331
80. The _____ function specifies the text format of numeric values.
ANSWER: format-number()
REFERENCES: XML 342
81. The _____ keyword is used to divide one numeric value by another.
Cengage Learning Testing, Powered by Cognero Page 12
Name: Class: Date:
ANSWER: div
REFERENCES: XML 342
82. The _____ function returns the current node being processed.
ANSWER: current()
REFERENCES: XML 342
83. If you place the _____ element at the end of your style sheet it will have precedence over the active style sheet.
ANSWER: include
REFERENCES: XML 339
84. The _____ function calculates the sum of the numeric values in a node set.
ANSWER: sum()
REFERENCES: XML 342
85. An important task is to combine, or _____, two or more text strings into a single text string.
ANSWER: concatenate
REFERENCES: XML 356
87. The locations in the style sheet where a variable can be referenced are known as the variable’s _____.
ANSWER: scope
REFERENCES: XML 327
88. Define the term scope, and describe the role of scope in the creation of XSLT style sheets, including an explanation
the implication of a variable's possible scope.
ANSWER: The locations in the style sheet where a variable can be referenced are known as the variable’s scope.
The scope is determined by where the variable is defined. In general, a variable can only be referenced
within the element in which it is defined. Variables are said to have either global or local scope.
A variable with global scope, also known as a global variable, can be referenced from anywhere within
a style sheet. To create a global variable, the <xsl:variable> tag must be at the top level of the
style sheet, as a direct child of the stylesheet element. Because global variables are referenced
anywhere in a style sheet, each global variable must have a unique variable name to avoid conflicts
with variable names defined with the same name elsewhere in the style sheet. The advantage of a
global variable is that it can be referenced within any template in the style sheet.
A variable that is created within an element, such as a template, is known as a local variable, has local
scope, and can be referenced only within that element or template. Unlike global variables, local
variables can share the same variable name if they are declared in different elements or templates. You
can also assign the same name to a global variable and a local variable. In this case, an XSLT
processor uses the local variable within the element in which it is defined and the global variable
anyplace else it is referenced. Even though the same variable name can be used in the situation
just described, it is best practice to give each variable a unique name, regardless of whether it is a
global or a local variable, in order to avoid confusion.
Cengage Learning Testing, Powered by Cognero Page 13
Name: Class: Date:
89. List the three possible ways of accessing data from multiple source documents within an XSLT style sheet.
ANSWER: There are three ways of accessing data from multiple source documents within an XSLT style sheet:
The XSLT 1.0 document() and XPath 2.0 doc() functions perform similar tasks and are used to
retrieve node sets from XML source documents. The unparsed-text() function is used to access
non-XML content stored within a text file, such as a CSV, or comma-separated values, text file.
90. XSLT is considered a functional programming language. Define functional programming, and describe at least three
of the key design principles of functional programming languages.
ANSWER: XSLT is an example of functional programming, which relies on the evaluation of functions and
expressions, rather than on the sequential execution of commands.
Functional programming languages such as XSLT are instead designed around the following
principles:
The important overall principle to keep in mind with functional programs is to think of tasks in terms
of functions rather than loops and assignment statements.
Identify the letter of the choice that best matches the phrase or definition.
a. result tree fragment
b. global variable
c. identity template
d. copy-of element
e. copy element
f. mod operator
g. per-mille
h. normalize-space()
i. paramters
j. xsl:with-param
REFERENCES: XML 327
XML 350
XML 362
Cengage Learning Testing, Powered by Cognero Page 14
Name: Class: Date:
XML 326
XML 362
XML 332
XML 353
XML 332
XML 333
XML 360
92. Provides the remainder after performing a division of one number by another
ANSWER: f
93. Similar to variables except that their values can be passed to them from outside their scope
ANSWER: i
94. Often used in projects in which the same code samples need to be repeatedly written to the result document
ANSWER: a
95. Element that sets the value of the template parameters defined within a named template
ANSWER: j
96. Matches any kind of node in the source document and copies them to the result document
ANSWER: c
100. Function used to remove extraneous white space characters from the beginning or end of any text string
ANSWER: h
Another report for 1785 gives the state of schools for that date.
[Sidenote: One
There are several schools in the verge of our school the
monthly meeting, kept by members of our property of the
society, one of which belongs to the monthly monthly meeting]
meeting, with several acres of land, whereon Friends are now
building a house for a master, which when completed there
will be a small fund towards schooling poor children.[579]
For the next six years there are but two reports worthy of attention,
which may be briefly summarized in this manner:
1787 [Sidenote: The
state of schools in
1. One school, under the monthly meeting, 1787]
SUMMARY
This chapter considers the establishment of [Sidenote: The
schools in Kennett, New Garden, Goshen, meetings]
Bradford, Uwchlan, London Grove and Sadsbury
monthly meetings.
No early definite reference is made to education, [Sidenote:
though the careful interest in children’s welfare is at Kennett]
all times evident. Not until the “1777 era” do the [Sidenote: A
reports give any considerable information union school
concerning schools. Committees were thereafter reported]
always in attendance upon the problems of the [Sidenote: Rules
schools. In 1781 a “union school” was reported drawn for school,
between Kennett, Bradford and New Garden, property
purchased]
which was afterwards discontinued. In 1785 they
report “several schools,” in partial accord with demands of the yearly
meeting. Land for Kennett school “number one” was purchased in
1792, and rules drawn up for its control. Their scheme for raising
permanent funds was not completed until 1795. Two schools, taught
by members of the society, were under the care of the meeting’s
committee in 1798.
Two schools were reported at New Garden in [Sidenote: Two
1779 and another was at that time proposed. Some schools under
land was conveyed to the meeting in 1785 for the Kennett meeting]
use of a school, and a house built upon it. Another [Sidenote: Two
piece of land was deeded by William Jackson in schools, another
1794 for a similar purpose. Certain stipulations proposed]
were made concerning the school to be established
there. It was found more consistent in summer to employ mistresses
rather than masters.
Though established at a late date, Goshen was [Sidenote:
very active educationally. Land was purchased and Goshen]
a house was being built for a union school between
Goshen, Bradford and Birmingham, in 1779. [Sidenote: schools]
Two