Moved tests from testsuite to web.servlet

This commit is contained in:
Arjen Poutsma
2008-11-03 12:25:46 +00:00
parent 91576da3b0
commit 0bcc8fcead
12 changed files with 25 additions and 19 deletions

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- invalid template - should not be loaded by TransformerFactory -->
<xsl:template match="/">
<xsl:sort order="ascending">
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<head><title>Hello!</title></head>
<body>
<h1>My First Words</h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="word">
<xsl:value-of select="."/><br/>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,6 @@
<products>
<product id="1" name="Whatsit" price="12.99"/>
<product id="2" name="Thingy" price="13.99"/>
<product id="3" name="Gizmo" price="14.99"/>
<product id="4" name="Cranktoggle" price="11.99"/>
</products>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="productsImport.xsl"/>
<xsl:output method="xml" indent="yes" media-type="text/html"/>
<xsl:param name="title"/>
<xsl:template match="/products/product">
<tr>
<td>
<xsl:value-of select="@id"/>
</td>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@price"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" media-type="text/html"/>
<xsl:param name="title"/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="$title"/></title>
</head>
<body>
<table>
<xsl:apply-templates select="/products/product"/>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="sex">Female</xsl:param>
<xsl:template match="*">
<xsl:element name="hero">
<xsl:attribute name="name">
<xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:attribute name="age">
<xsl:value-of select="@age"/>
</xsl:attribute>
<xsl:attribute name="catchphrase">
<xsl:value-of select="@catchphrase"/>
</xsl:attribute>
<xsl:attribute name="sex">
<xsl:value-of select="$sex"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="sex">Female</xsl:param>
<xsl:template match="*">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
This is a valid template!
</xsl:template>
</xsl:stylesheet>