xref: /aosp_15_r20/external/apache-xml/test/tests/api/trax/TransformerAPIHTMLFormat.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3  <!-- FileName: TransformerAPIHTMLFormat.xsl -->
4  <!-- Purpose: Legal HTML output for use with OutputPropertiesTest.java -->
5
6<!-- Include various XSLT spec xsl:output attrs -->
7<xsl:output method="html"
8            media-type="text/test/xml"
9            omit-xml-declaration="yes" />
10
11<xsl:template match="/">
12  <HTML>
13  <xsl:apply-templates/>
14  </HTML>
15</xsl:template>
16
17<xsl:template match="html-tag">
18    <HEAD>
19      <xsl:element name="TITLE"><xsl:value-of select="head-tag/title-tag/@text"/></xsl:element>
20      <xsl:text>xsl:text within HEAD tag</xsl:text>
21    </HEAD>
22    <BODY>
23    <xsl:apply-templates select="body-tag"/>
24    <xsl:text disable-output-escaping="yes">&lt;P>Fake 'p' element&lt;/P></xsl:text>
25    <!-- Some HTML elements below, just for fun -->
26    <P>&#064; &#160; &#126; &#169; &#200;</P>
27    </BODY>
28</xsl:template>
29
30<xsl:template match="body-tag">
31    <xsl:apply-templates select="p-tag | ul-tag"/>
32</xsl:template>
33
34<xsl:template match="p-tag">
35  <xsl:element name="P">
36    <xsl:value-of select="."/>
37    <xsl:apply-templates select="br-tag | hr-tag"/>
38  </xsl:element>
39</xsl:template>
40
41<xsl:template match="ul-tag">
42  <UL>
43    <xsl:copy-of select="."/>
44  </UL>
45</xsl:template>
46
47<xsl:template match="br-tag">
48  <BR/>
49</xsl:template>
50
51<xsl:template match="hr-tag">
52  <HR></HR>
53</xsl:template>
54
55
56
57  <!--
58   * Licensed to the Apache Software Foundation (ASF) under one
59   * or more contributor license agreements. See the NOTICE file
60   * distributed with this work for additional information
61   * regarding copyright ownership. The ASF licenses this file
62   * to you under the Apache License, Version 2.0 (the  "License");
63   * you may not use this file except in compliance with the License.
64   * You may obtain a copy of the License at
65   *
66   *     http://www.apache.org/licenses/LICENSE-2.0
67   *
68   * Unless required by applicable law or agreed to in writing, software
69   * distributed under the License is distributed on an "AS IS" BASIS,
70   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71   * See the License for the specific language governing permissions and
72   * limitations under the License.
73  -->
74
75</xsl:stylesheet>
76