Test regime for OASIS XSLT/XPath Conformance

1. Introduction

OASIS has produced a test system for XSLT processors. Since XSLT depends so heavily on XPath, it also serves to test XPath expressions.

This test suite has been developed as an instance of a test regime within the OASIS generic test framework.

2. Status values allowed for discretionary items

The XSLT discretionary items in the summary are grouped by their status accoding the values listed here.

2.1 <item status="Implemented">

controlling test selection in the current version

2.2 <item status="Active">

proposed for testing in the next deliverable version

2.3 <item status="Postponed">

proposed to postpone

2.4 <item status="Configuration">

acknowledged as discretionary but considered not testable

2.5 <item status="Recognized">

out of scope for conformance testing

3. Test case categories

Each XSLT test case must be categorized as to the nature of the test according to the categories listed here.

This allows users of the test cases to only address a subset of the tests by their nature.

3.1 <test-case category="XSLT-Structure">

stylesheet/transform, namespaces, import, include

3.2 <test-case category="XSLT-Data-Model">

treatment of source XML, text + whitespace, entities

3.3 <test-case category="XSLT-Template">

matching, call named, priority

3.4 <test-case category="XSLT-Result-Tree">

creation of nodes in result

3.5 <test-case category="XSLT-Data-Manipulation">

sort, for-each, conditionals, variables, keys

3.6 <test-case category="XSLT-Extendability">

functions and instructions related to extendability

3.7 <test-case category="XSLT-Output">

output, message

3.8 <test-case category="XPath-Location-Path">

axes, node tests, predicates

3.9 <test-case category="XPath-Expression">

operators, type conversion

3.10 <test-case category="XPath-Core-Function">

all XPath functions

3.11 <test-case category="XPath-Data-Model">

all other XPath not covered above

3.12 <test-case category="Mixed">

would fit into more than one category

4. Citations into Recommendation documents

Both the discretionary and test case documents make citations into Recommendations.

4.1 Citation types

These are the allowed methods of citing specifications as configured for the regime.

4.1.1 <spec-citation type="section">

section heading in rendered Rec, must have number at start

4.1.2 <spec-citation type="anchor">

HTML-style anchor

4.1.3 <spec-citation type="XPointer">

id from document, optionally followed by XPath to qualify further

4.2 Citation specifications

These are the allowed Recommendations to be cited by the descretionary document or test cases.

4.2.1 <spec-citation spec="XSLT" version="1.0" type="section">

numbered chapter/section/subsection

4.2.2 <spec-citation spec="XSLT" version="1.0" type="XPointer">

from available id

4.2.3 <spec-citation spec="XSLT" version="1.0" type="anchor">

available anchors

4.2.4 <spec-citation spec="XPath" version="1.0" type="section">

numbered chapter/section

4.2.5 <spec-citation spec="XPath" version="1.0" type="XPointer">

from available id

4.2.6 <spec-citation spec="XPath" version="1.0" type="anchor">

available anchors

4.2.7 <spec-citation spec="XML-stylesheet" version="1.0" type="section">

numbered chapter

4.2.8 <spec-citation spec="XML-stylesheet" version="1.0" type="XPointer">

from available id

4.2.9 <spec-citation spec="XML-stylesheet" version="1.0" type="anchor">

available anchors

4.2.10 <spec-citation spec="XSLT-Errata" version="1.0" type="section">

It is assumed that multiple editions of XSLT errata are cumulative, thus later editions subsume the errata of earlier editions.

These are the "Known errors as of [date]" sections

4.2.11 <spec-citation spec="XSLT-Errata" version="1.0" type="anchor">

It is assumed that multiple editions of XSLT errata are cumulative, thus later editions subsume the errata of earlier editions.

Erratum are numbered, starting with E1, and matching anchors exist for each.

4.2.12 <spec-citation spec="XPath-Errata" version="1.0" type="section">

It is assumed that multiple editions of XPath errata are cumulative, thus later editions subsume the errata of earlier editions.

Has sections parallel to sections of base document.

4.2.13 <spec-citation spec="XPath-Errata" version="1.0" type="anchor">

It is assumed that multiple editions of XPath errata are cumulative, thus later editions subsume the errata of earlier editions.

Whatever anchors we can find....

5. Gray areas

Areas that are not discretionary but may be cited by a test case as being vague.

5.1 <gray-area-choice name="number-max-roman-numeral">

The largest number that a test case may safely assume can be formatted as a Roman numeral by xsl:number.

  • Doc: http://www.w3.org/TR/1999/REC-xslt-19991116 Section: 7.7.1
  • http://www.w3.org/TR/1999/REC-xslt-19991116.xml#xpointer(id(convert)/ulist[1]/item[5]/p[1]/text()[1])
  • 5.2 <gray-area-choice name="number-NaN-handling">

    The erratum turned this into a discretionary item: It is an error if the number is NaN, infinite or less than 0.5; an XSLT processor may signal the error; if it does not signal the error, it must recover by converting the number to a string as if by a call to the string function and inserting the resulting string into the result tree.

    5.3 <gray-area-choice name="number-any-no-nodes">

    Prior to the erratum, there was no specification for how xsl:number level="any" should deal with an empty node-set.

    The erratum made this similar to level="single" by saying: If there are no matching nodes, it constructs an empty list.

    If the test makes this empty-list choice, it may also be marked for an errata-add of 2000-12-12 on XSLT Version 1.0.

    6. Scenarios

    Both the discretionary and test case documents make citations into Recommendations.

    6.1 Operations

    6.1.1 <scenario operation="standard">

    2 principal inputs, one principal output

    specify both a principal-data and principal-stylesheet type of input-file

    6.1.2 <scenario operation="embedded">

    input is XML data with embedded styling (principal-data only)

    6.1.3 <scenario operation="external-param">

    like standard but also has parameters passed in

    6.1.4 <scenario operation="execution-error">

    2 principal inputs, but NOT expected to generate output

    6.1.5 <scenario operation="result-analysis">

    like standard but something interactive happens

    Use this classification when human examination of console or output is needed.

    6.2 Roles for input and output files

    Principal files must be name only (with filetype extension/tag included), not a path.

    Supplemental files may have relative paths with / separators

    Constraint: names for output-files, both principal and supplemental, must be designed so that all test cases sharing a submitter/file-path directory may be run in one batch with no naming conflicts.

    6.2.1 <input-file/output-file role="principal-data">

    the XML data to be processed, generally called the "source tree" in the Recommendation, specified as an argument when invoking the XSLT processor

    6.2.2 <input-file/output-file role="principal-stylesheet">

    the stylesheet to be specified as an argument when invoking the XSLT processor

    6.2.3 <input-file/output-file role="principal">

    for output only: transformation result named at invocation

    6.2.4 <input-file/output-file role="supplemental-data">

    for input only: extra file read by document() or similar

    6.2.5 <input-file/output-file role="supplemental-stylesheet">

    for input only: extra stylesheet read by xsl:import or similar

    6.2.6 <input-file/output-file role="supplemental-params">

    for input only: file specifying how to set external parameters

    6.2.7 <input-file/output-file role="supplemental">

    for output only: extra file from console log, xsl:document, etc.

    6.3 Comparison types for output files

    Most output files can be compared mechanically, but the 'manual' is provided when this is not possible.

    6.3.1 <output-file compare="XML">

    XML in a file

    6.3.2 <output-file compare="HTML">

    HTML in a file

    6.3.3 <output-file compare="Text">

    text in a file

    6.3.4 <output-file compare="manual">

    the output cannot be automatically verified

    Use this for generate-id when a human must verify that the generated id meets constraints, and for all the vendor-specific strings returned by system-property.

    6.3.5 <output-file compare="ignore">

    the output should not have been generated

    6.4 Parameter types during invocation

    Not all XSLT processors support all data types for parameters

    6.4.1 <param-set type="string">

    XPath string data type

    6.4.2 <param-set type="number">

    XPath number data type

    6.4.3 <param-set type="boolean">

    XPath boolean data type

    $Date: 2005/04/06 20:55:17 $(UTC)