In XML processing with XSLT: which document tells the XSLT processor how to transform the elements of a source XML document into another format (such as HTML, text, or a different XML shape)?
-
AHTML page
-
BDOCTYPE procedure
-
CStylesheet
-
DStored procedure
Answer
Correct Answer: Stylesheet
Explanation
Introduction / Context:XSLT (Extensible Stylesheet Language Transformations) is the W3C standard language for transforming XML data into other formats. To run a transformation, the processor needs instructions that describe the mapping from source nodes to output. This question asks you to identify the artifact that contains those instructions.
Given Data / Assumptions:
- The source is a well-formed XML document.
- The transformation is performed by an XSLT processor.
- We are targeting an output such as HTML, plain text, or another XML.
Concept / Approach:The XSLT stylesheet (commonly a .xsl or .xslt file) contains template rules, match patterns, and instructions (for-each, apply-templates, value-of, etc.). The processor reads the stylesheet and applies those rules to the input XML tree to generate the result tree.
Step-by-Step Solution:
Identify what carries transformation logic: template rules and instructions.Recall that XSLT stores these in a stylesheet document (root element xsl:stylesheet or xsl:transform).Conclude that the correct answer is “Stylesheet.”Verification / Alternative check:Any typical XSLT run uses an XML input, an XSLT stylesheet, and produces a result; if the stylesheet is missing, no mapping rules exist.
Why Other Options Are Wrong:
- HTML page: an output format, not the transformation rule-set.
- DOCTYPE procedure: DOCTYPE declares a DTD, not transformation logic.
- Stored procedure: a database concept, unrelated to XSLT.
Common Pitfalls:Confusing the output HTML file with the stylesheet that generated it; the stylesheet is the transformation specification.
Final Answer:Stylesheet