xref: /aosp_15_r20/external/apache-xml/test/tests/perf/output/outputHhref.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3<xsl:output method="html"/>
4
5  <!-- Purpose: ESC of non-ASCII chars in URI attribute	values using method
6       cited in Section B.2.1 of HTML 4.0 Spec. -->
7
8<xsl:template match="doc">
9  <html>
10  <head>
11    <title>
12      <xsl:value-of select="header"/>
13    </title>
14  </head>
15  <!-- Note the body/@background should be escaped as well, I think -->
16  <body background="file&apos;&#037;.gif">
17    <xsl:apply-templates select="list"/>
18  </body>
19  </html>
20</xsl:template>
21
22<xsl:template match="list">
23  <h1>List</h1>
24  <xsl:apply-templates select="list | item"/>
25</xsl:template>
26
27<!-- A simplistic template for testing performance of HTML escaping;
28     vaguely like what you might see in real life.  Includes various
29     avt's interspersed with escaped characters and one non-escaped
30     attribute font/@color.
31-->
32<xsl:template match="item">
33  <br/>
34  spacer
35
36    <p>1. "&amp;"  <A HREF="&amp;{.}"><xsl:copy-of select="text()"/></A></p>
37    <p>2. "&lt;"   <img src="&lt;"></img></p>
38    <p>3. "&gt;"   <IMG src="&gt;"></IMG></p>
39    <p>4. "&quot;" <img SRC="&quot;{text()}"/></p>
40    <p>5. "&apos;" <font color="&apos;"><xsl:copy-of select="text()"/></font></p>
41    <p>6. "&#169;" <a HREF="&#169;"><xsl:value-of select="text()"/></a></p>
42    <p>7. "&#035;" <A href='&amp;{{text()}}between&#035;after'>Note the amp-double-braces should be escaped differently</A></p>
43    <p>8. "&#165;" <A href="&#165;after"><xsl:value-of select="text()"/></A></p>
44    <p>9. "&#032;" <a href="before&#032;"><xsl:copy-of select="text()"/></a></p>
45    <p>10."&#037;" <IMG SRC="{.}&#037;"><xsl:value-of select="."/></IMG></p>
46    <p>11."&#009;" <A href="beforeand&#009;after">No value</A></p>
47    <p>12."&#127;" <A HREF="{.}&#127;after"><xsl:value-of select="."/></A></p>
48    <p>13."&#209;" <A href="&#209;">plain text</A></p>
49    <P>14."&#338;" <A href="&#338;">more plain text</A></P>
50</xsl:template>
51
52
53  <!--
54   * Licensed to the Apache Software Foundation (ASF) under one
55   * or more contributor license agreements. See the NOTICE file
56   * distributed with this work for additional information
57   * regarding copyright ownership. The ASF licenses this file
58   * to you under the Apache License, Version 2.0 (the  "License");
59   * you may not use this file except in compliance with the License.
60   * You may obtain a copy of the License at
61   *
62   *     http://www.apache.org/licenses/LICENSE-2.0
63   *
64   * Unless required by applicable law or agreed to in writing, software
65   * distributed under the License is distributed on an "AS IS" BASIS,
66   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
67   * See the License for the specific language governing permissions and
68   * limitations under the License.
69  -->
70
71</xsl:stylesheet>
72