Test on XSLT and XPath for XML Transformation
XSLT and XPath for XML Transformation: A Student Guide
Test: XSLT and XML Transformations, XSLT and XPath (XML Transformations)
20 questions
Question 1: The CSS Paged Media includes features such as `page-break-before`, `page-break-after`, and `page-break-inside`.
A. Ano
B. Ne
Explanation: The study materials explicitly list `page-break-before`, `page-break-after`, `page-break-inside`, `orphans`, `widows`, and `@page` as features of CSS Paged Media.
Question 2: A fill-in-blank stylesheet typically has the same structure as the desired output.
A. Ano
B. Ne
Explanation: The study materials state that for fill-in-blank stylesheets, 'The stylesheet has the same structure as the desired output.'
Question 3: According to the study materials, which of the following statements is true regarding XSLT stylesheet composition using `<xsl:include>` and `<xsl:import>`?
A. Only `<xsl:include>` is used for composition of stylesheets.
B. `<xsl:import>` has a lower precedence compared to `<xsl:include>` when composing stylesheets.
C. Both `<xsl:include>` and `<xsl:import>` are identical in their functionality and precedence.
D. `<xsl:include>` is used for integrating external stylesheets, while `<xsl:import>` is for internal stylesheet sections.
Explanation: The study materials state that `<xsl:include>` is for "Composition of stylesheets" and that `<xsl:import>` is "Like above, has a lower precedence (priority)". This directly indicates that `<xsl:import>` has a lower precedence than the mechanism referred to as 'like above', which is `<xsl:include>` in the context of stylesheet composition.
Question 4: According to the study materials, which of the following are considered basic features of XSLT?
A. <xsl:template>
B. <xsl:variable>
C. <xsl:for-each>
D. <xsl:include>
Explanation: The study materials list <xsl:template> (for choosing the input tree) and <xsl:for-each> (for looping) as basic features. <xsl:variable> and <xsl:include> are mentioned under 'More features', indicating they are not categorized as basic features.
Question 5: The XPath expression `/university/student[age='23.00']` selects all student elements whose 'age' element has a value *exactly* equal to '23.00'.
A. Ano
B. Ne
Explanation: The study materials show an example `/university/student[age>23.00]` which uses a greater than operator (>) to select student elements with an age value greater than 23.00. While XPath can select by exact value, the provided materials only demonstrate selecting by attribute value using '=' (e.g., `//title[@lang='eng']`) or by element content using comparison operators (e.g., `price>35.00` or `age>23.00`), but not an exact match for an element's text content value using `=` in the context shown. The examples provided use operators like `>` for element value conditions, or `=` for attribute value conditions.