xref: /aosp_15_r20/external/apache-xml/test/tests/conferr/vererr/vererr02.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3				version="0.5">
4
5  <!-- FileName: VERerr02 -->
6  <!-- Document: http://www.w3.org/TR/xslt -->
7  <!-- DocVersion: 19991116 -->
8  <!-- Section: 2.5 Forwards-Compatible Processing  -->
9  <!-- Creator: David Marston -->
10  <!-- Purpose: Test validation when version is lower than supported version. -->
11  <!-- ExpectedException: xsl:exciting-new-8.5-feature is not allowed in this position in the stylesheet -->
12
13  <xsl:template match="/">
14    <out>
15      Choosing, based on value of version property.
16      <xsl:choose>
17        <xsl:when test="system-property('xsl:version') &gt;= 0.5">
18          We are trying to use the 8.5 feature in an earlier version.
19          <xsl:exciting-new-8.5-feature/>
20        </xsl:when>
21        <xsl:otherwise>
22          We didn't try to use the 8.5 feature, but we should have.
23          <xsl:message>This stylesheet requires XSLT 0.5 or higher</xsl:message>
24        </xsl:otherwise>
25      </xsl:choose>
26    </out>
27  </xsl:template>
28
29
30  <!--
31   * Licensed to the Apache Software Foundation (ASF) under one
32   * or more contributor license agreements. See the NOTICE file
33   * distributed with this work for additional information
34   * regarding copyright ownership. The ASF licenses this file
35   * to you under the Apache License, Version 2.0 (the  "License");
36   * you may not use this file except in compliance with the License.
37   * You may obtain a copy of the License at
38   *
39   *     http://www.apache.org/licenses/LICENSE-2.0
40   *
41   * Unless required by applicable law or agreed to in writing, software
42   * distributed under the License is distributed on an "AS IS" BASIS,
43   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44   * See the License for the specific language governing permissions and
45   * limitations under the License.
46  -->
47
48</xsl:stylesheet>
49