curcuru 01/02/28 12:59:30
Added: test/tests/perf/output outputHhref.xml outputHhref.xsl
Log:
Performance test files: focus on HTML href/src escaping of URLs
Revision Changes Path
1.1 xml-xalan/test/tests/perf/output/outputHhref.xml
Index: outputHhref.xml
===================================================================
<?xml version="1.0"?>
<doc>
<header>This is the title</header>
<list>
<item>ItemSpace 1</item>
<item>Item2</item>
<item>ItemTab 3</item>
<list>
<item>Item A</item>
<item>Item B</item>
</list>
</list>
</doc>
1.1 xml-xalan/test/tests/perf/output/outputHhref.xsl
Index: outputHhref.xsl
===================================================================
<?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'%.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. "&" <A HREF="&{.}"><xsl:copy-of select="text()"/></A></p>
<p>2. "<" <img src="<"></img></p>
<p>3. ">" <IMG src=">"></IMG></p>
<p>4. """ <img SRC=""{text()}"/></p>
<p>5. "'" <font color="'"><xsl:copy-of
select="text()"/></font></p>
<p>6. "©" <a HREF="©"><xsl:value-of select="text()"/></a></p>
<p>7. "#" <A href='&{{text()}}between#after'>Note the
amp-double-braces should be escaped differently</A></p>
<p>8. "¥" <A href="¥after"><xsl:value-of
select="text()"/></A></p>
<p>9. " " <a href="before "><xsl:copy-of
select="text()"/></a></p>
<p>10."%" <IMG SRC="{.}%"><xsl:value-of select="."/></IMG></p>
<p>11."	" <A href="beforeand	after">No value</A></p>
<p>12."" <A HREF="{.}after"><xsl:value-of select="."/></A></p>
<p>13."Ñ" <A href="Ñ">plain text</A></p>
<P>14."Œ" <A href="Œ">more plain text</A></P>
</xsl:template>
</xsl:stylesheet>