XSLT

XSLT

Test your XSLT knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is the primary purpose of XSLT?

    • Store large datasets
    • Define document structure
    • Transform XML documents
    • Style HTML pages
  2. What does XSLT stand for?

    • XML Script Language Tool
    • Extensible Stylesheet Language Transformations
    • External Stylesheet Language Template
    • Extra Syntax Layout Tool
  3. What is the root element of an XSLT stylesheet?

    • <stylesheet>
    • <xml>
    • <xsl:stylesheet>
    • <transform>
  4. Which element matches XML elements in XSLT?

    • <xsl:match>
    • <xsl:template>
    • <xsl:select>
    • <xsl:value>
  5. What is the function of <xsl:value-of>?

    • Assign a value to a variable
    • Loop over elements
    • Output the value of a node
    • Create an element
  6. What does <xsl:apply-templates select="book"/> do?

    • Creates a new XML file
    • Outputs all elements named book
    • Applies matching templates to all book elements
    • Deletes book elements
  7. What is the difference between <xsl:call-template> and <xsl:apply-templates>?

    • call-template uses a named template; apply-templates matches by pattern
    • apply-templates is faster
    • call-template loops over elements
    • There is no difference
  8. What is the purpose of <xsl:with-param>?

    • To import variables
    • To define a function
    • To pass values to templates
    • To sort parameters
  9. How do you define a named template in XSLT?

    • <xsl:template match="name">
    • <xsl:template name="name">
    • <xsl:template id="name">
    • <xsl:named-template>
  10. What does <xsl:sort select="@price"/> do?

    • Filters by price
    • Reverses the list
    • Sorts nodes based on their price attribute
    • Adds prices
  11. What is one key feature of XSLT 2.0 over 1.0?

    • No need for XPath
    • Native support for JSON
    • Support for regular expressions
    • Removal of template rules
  12. What is the main purpose of recursion in XSLT?

    • Loop through HTML elements
    • Iterate complex nested structures
    • Display XML as-is
    • Import external scripts
  13. Which function is used in XSLT 2.0 to tokenize a string?

    • split()
    • tokenize()
    • break()
    • separate()
  14. What is grouping in XSLT?

    • Merging multiple XML files
    • Repeating templates
    • Collecting similar elements together
    • Filtering data
  15. Which method is used for grouping in XSLT 2.0?

    • xsl:group
    • xsl:grouping
    • xsl:for-each-group
    • xsl:classify