summaryrefslogtreecommitdiff
path: root/test/tests/perf/output/outputHhref.xsl
blob: 77996561a870c025eb06285621636f20ec2afc76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="ISO-8859-1"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>

  <!-- Purpose: ESC of non-ASCII chars in URI attribute	values using method 
       cited in Section B.2.1 of HTML 4.0 Spec. -->

<xsl:template match="doc">
  <html>
  <head>
    <title>
      <xsl:value-of select="header"/>
    </title>
  </head>
  <!-- Note the body/@background should be escaped as well, I think -->
  <body background="file&apos;&#037;.gif">
    <xsl:apply-templates select="list"/>
  </body>
  </html>
</xsl:template>

<xsl:template match="list">
  <h1>List</h1>
  <xsl:apply-templates select="list | item"/>
</xsl:template>

<!-- A simplistic template for testing performance of HTML escaping; 
     vaguely like what you might see in real life.  Includes various 
     avt's interspersed with escaped characters and one non-escaped 
     attribute font/@color.
-->
<xsl:template match="item">
  <br/>
  spacer
  
    <p>1. "&amp;"  <A HREF="&amp;{.}"><xsl:copy-of select="text()"/></A></p>
    <p>2. "&lt;"   <img src="&lt;"></img></p>
    <p>3. "&gt;"   <IMG src="&gt;"></IMG></p>
    <p>4. "&quot;" <img SRC="&quot;{text()}"/></p>
    <p>5. "&apos;" <font color="&apos;"><xsl:copy-of select="text()"/></font></p>
    <p>6. "&#169;" <a HREF="&#169;"><xsl:value-of select="text()"/></a></p>
    <p>7. "&#035;" <A href='&amp;{{text()}}between&#035;after'>Note the amp-double-braces should be escaped differently</A></p>
    <p>8. "&#165;" <A href="&#165;after"><xsl:value-of select="text()"/></A></p>
    <p>9. "&#032;" <a href="before&#032;"><xsl:copy-of select="text()"/></a></p>
    <p>10."&#037;" <IMG SRC="{.}&#037;"><xsl:value-of select="."/></IMG></p>
    <p>11."&#009;" <A href="beforeand&#009;after">No value</A></p>
    <p>12."&#127;" <A HREF="{.}&#127;after"><xsl:value-of select="."/></A></p>
    <p>13."&#209;" <A href="&#209;">plain text</A></p>
    <P>14."&#338;" <A href="&#338;">more plain text</A></P>
</xsl:template>
  

  <!--
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements. See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership. The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the  "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
  -->

</xsl:stylesheet>