xref: /aosp_15_r20/external/apache-xml/test/tests/conf/mdocs/mdocs16.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                version="1.0">
4
5  <!-- FileName: mdocsXXX -->
6  <!-- Document: http://www.w3.org/TR/xslt -->
7  <!-- DocVersion: 19991116 -->
8  <!-- Section: 12.1 -->
9  <!-- Purpose: Compare two evaluation sequences for variable containing
10    node-set returned from document() call. -->
11  <!-- Author: Norm Walsh -->
12
13<xsl:output method="xml" indent="yes"/>
14
15<xsl:param name="terms" select="document('terms.xml')"/>
16
17<xsl:template match="/">
18<out>
19  <xsl:call-template name="gentext">
20    <xsl:with-param name="key" select="'TableofContents'"/>
21    <xsl:with-param name="lang" select="'en'"/>
22  </xsl:call-template>
23</out>
24</xsl:template>
25
26<xsl:template name="gentext">
27  <xsl:param name="key" select="local-name(.)"/>
28  <xsl:param name="lang" select="FOO"/>
29  <xsl:variable name="lookup"
30    select="($terms/table/expand[@language=$lang]/gentext[@key=$key])[1]"/>
31  <xsl:variable name="l10n.name" select="$lookup/@text"/>
32  <xsl:element name="key"><xsl:value-of select="$key"/></xsl:element>
33  <xsl:element name="lang"><xsl:value-of select="$lang"/></xsl:element>
34  <xsl:element name="var"><xsl:value-of select="$l10n.name"/></xsl:element>
35  <xsl:element name="text"><xsl:value-of select="$lookup/@text"/></xsl:element>
36</xsl:template>
37
38
39  <!--
40   * Licensed to the Apache Software Foundation (ASF) under one
41   * or more contributor license agreements. See the NOTICE file
42   * distributed with this work for additional information
43   * regarding copyright ownership. The ASF licenses this file
44   * to you under the Apache License, Version 2.0 (the  "License");
45   * you may not use this file except in compliance with the License.
46   * You may obtain a copy of the License at
47   *
48   *     http://www.apache.org/licenses/LICENSE-2.0
49   *
50   * Unless required by applicable law or agreed to in writing, software
51   * distributed under the License is distributed on an "AS IS" BASIS,
52   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53   * See the License for the specific language governing permissions and
54   * limitations under the License.
55  -->
56
57</xsl:stylesheet>
58