summaryrefslogtreecommitdiff
path: root/tests/documents
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-02-11 20:12:24 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-02-11 20:12:24 +0000
commita9087e93b90a5e340070da86fa1be2c865492f15 (patch)
tree90c273b2668e3bfcb9c720932fa30080988f629d /tests/documents
parent08d6d40a944a94a6d78fd415e7ef1aa66a4a8213 (diff)
downloadlibxslt-a9087e93b90a5e340070da86fa1be2c865492f15.tar.gz
libxslt-a9087e93b90a5e340070da86fa1be2c865492f15.tar.bz2
libxslt-a9087e93b90a5e340070da86fa1be2c865492f15.zip
Cleanups, fixes, tests:
- libxslt/documents.[ch] libxslt/functions.c libxslt/imports.c libxslt/xslt.c libxslt/xsltInternals.h: changed teh way to store Includes, more document changes - libxslt/xsltutils.c: fix the output of doctype and what is or is not HTML - tests/REC/*.out tests/REC2/html.xml : changed output accordingly - tests/Makefile.am tests/documents/* : added a new test from Stric exercising document() among other things Daniel
Diffstat (limited to 'tests/documents')
-rw-r--r--tests/documents/Makefile.am19
-rw-r--r--tests/documents/bredfort.css53
-rw-r--r--tests/documents/bredfort.xsl104
-rw-r--r--tests/documents/index.xml10
-rw-r--r--tests/documents/menu.xml5
-rw-r--r--tests/documents/result.xhtml16
-rw-r--r--tests/documents/system.xml29
-rw-r--r--tests/documents/worklog.xml64
8 files changed, 300 insertions, 0 deletions
diff --git a/tests/documents/Makefile.am b/tests/documents/Makefile.am
new file mode 100644
index 00000000..85ecf2b8
--- /dev/null
+++ b/tests/documents/Makefile.am
@@ -0,0 +1,19 @@
+## Process this file with automake to produce Makefile.in
+
+$(top_builddir)/libxslt/xsltproc:
+ @(cd ../../libxslt ; make xsltproc)
+
+EXTRA_DIST = bredfort.css index.xml system.xml \
+ bredfort.xsl menu.xml worklog.xml \
+ result.xhtml
+
+
+all: test
+
+test tests: $(top_builddir)/libxslt/xsltproc
+ @(rm -f .memdump ; touch .memdump)
+ @($(top_builddir)/libxslt/xsltproc bredfort.xsl index.xml > result ; \
+ diff result.xhtml result ; \
+ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
+ rm -f result)
+
diff --git a/tests/documents/bredfort.css b/tests/documents/bredfort.css
new file mode 100644
index 00000000..6d68a843
--- /dev/null
+++ b/tests/documents/bredfort.css
@@ -0,0 +1,53 @@
+p.who {
+ font-size: small;
+ text-align: right;
+}
+
+hr.thin {
+ height: 1px;
+}
+
+table.progress {
+ border-spacing: 0px;
+ border-collapse: collapse;
+ text-align: center;
+ border-style: solid;
+ border-width: 1px;
+ border-bottom: hidden;
+
+}
+
+td:first-child.progress {
+ border-spacing: 0px;
+ border-style: solid;
+ border-right: hidden;
+ border-left: hidden;
+ border-width: 1px;
+}
+
+td.progress {
+ border-spacing: 0px;
+ border-style: solid;
+ border-right: hidden;
+ border-width: 1px;
+}
+
+th:first-child.progress {
+ border-spacing: 0px;
+ border-style: solid;
+ border-right: hidden;
+ border-left: hidden;
+ border-top: hidden;
+ border-width: 1px;
+ border-bottom: solid 2px;
+}
+
+th.progress {
+ border-spacing: 0px;
+ border-style: solid;
+ border-right: hidden;
+ border-width: 1px;
+ border-top: hidden;
+ border-bottom: solid 2px;
+}
+
diff --git a/tests/documents/bredfort.xsl b/tests/documents/bredfort.xsl
new file mode 100644
index 00000000..b6e4f6b0
--- /dev/null
+++ b/tests/documents/bredfort.xsl
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
+<xsl:output encoding="iso-8859-1" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="DTD/xhtml1-strict.dtd"/>
+<xsl:template match="page">
+<html xml:lang="en" lang="en">
+<head>
+<title>
+ <xsl:value-of select="@title"/>
+</title>
+<link rel="stylesheet" href="bredfort.css" type="text/css" title="bredfort"/>
+</head>
+<body>
+<xsl:apply-templates select="document('menu.xml')"/>
+<h1>
+ <xsl:value-of select="@title"/>
+</h1>
+<xsl:apply-templates/>
+</body>
+</html>
+</xsl:template>
+
+<xsl:template match="h2">
+<h2>
+ <xsl:apply-templates/>
+</h2>
+</xsl:template>
+
+<xsl:template match="menu">
+<table class="menu">
+<tr>
+<xsl:apply-templates/>
+</tr>
+</table>
+</xsl:template>
+
+<xsl:template match="menuitem">
+<td class="menu">
+ <a><xsl:attribute name="href">
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </a>
+</td>
+</xsl:template>
+
+<xsl:template match="week">
+<hr class="thin"/>
+<h2>Week <xsl:value-of select="@num"/></h2>
+<xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="what">
+<xsl:apply-templates/>
+<p class="who">
+ <xsl:value-of select="@who"/>
+</p>
+</xsl:template>
+
+
+<xsl:template match="p">
+<p> <xsl:apply-templates/> </p>
+</xsl:template>
+
+<xsl:template match="a">
+<a><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
+ <xsl:apply-templates/> </a>
+</xsl:template>
+
+
+<xsl:template match="st">
+<td class="progress"><xsl:apply-templates/>%</td>
+</xsl:template>
+
+
+<xsl:template match="progresstable">
+<table border="2" class="progress">
+<tr>
+ <th class="progress">Week</th>
+ <th class="progress">Sys. des.</th>
+ <th class="progress">Test des.</th>
+ <th class="progress">Sales cli.</th>
+ <th class="progress">Adm. cli.</th>
+ <th class="progress">Proxy</th>
+ <th class="progress">Sale serv.</th>
+ <th class="progress">Fac. serv.</th>
+ <th class="progress">Comp. test</th>
+ <th class="progress">Func. test</th>
+ <th class="progress">Syst. test</th>
+</tr>
+<xsl:apply-templates select="progress"/>
+</table>
+</xsl:template>
+
+
+
+<xsl:template match="progress">
+<tr>
+<td class="progress"><xsl:value-of select="@week"/></td>
+<xsl:apply-templates/>
+</tr>
+</xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/tests/documents/index.xml b/tests/documents/index.xml
new file mode 100644
index 00000000..3ca2af32
--- /dev/null
+++ b/tests/documents/index.xml
@@ -0,0 +1,10 @@
+<page title="Home">
+ <h2>Bredfort</h2>
+ Bredfort is: stric, nikke and janlert.
+
+ <h2>Tokband</h2>
+ Tokband is the software we're developing.
+
+ <h2>Worklog</h2>
+ Our worklog is <a href="worklog.html">here</a>.
+</page>
diff --git a/tests/documents/menu.xml b/tests/documents/menu.xml
new file mode 100644
index 00000000..b062686c
--- /dev/null
+++ b/tests/documents/menu.xml
@@ -0,0 +1,5 @@
+<menu>
+ <menuitem href="index.html">Home</menuitem>
+ <menuitem href="worklog.html">Worklog</menuitem>
+ <menuitem href="system.html">System spec</menuitem>
+</menu>
diff --git a/tests/documents/result.xhtml b/tests/documents/result.xhtml
new file mode 100644
index 00000000..1e040746
--- /dev/null
+++ b/tests/documents/result.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>Home</title><link rel="stylesheet" href="bredfort.css" type="text/css" title="bredfort"/></head><body><table class="menu"><tr>
+ <td class="menu"><a href="index.html">Home</a></td>
+ <td class="menu"><a href="worklog.html">Worklog</a></td>
+ <td class="menu"><a href="system.html">System spec</a></td>
+</tr></table><h1>Home</h1>
+ <h2>Bredfort</h2>
+ Bredfort is: stric, nikke and janlert.
+
+ <h2>Tokband</h2>
+ Tokband is the software we're developing.
+
+ <h2>Worklog</h2>
+ Our worklog is <a href="worklog.html">here</a>.
+</body></html>
diff --git a/tests/documents/system.xml b/tests/documents/system.xml
new file mode 100644
index 00000000..3ad93ece
--- /dev/null
+++ b/tests/documents/system.xml
@@ -0,0 +1,29 @@
+<page title="System spec">
+<h2>Dotcom</h2>
+<p>
+Dotcom is our factories, producing top-of-the-line high quality tokbands
+(although we're not really sure yet what a tokband is).
+</p>
+
+<h2>Amazon</h2>
+<p>
+Amazon is our sales server, responsible for the transactions and interfacing
+with our factories.
+</p>
+
+<h2>Meister</h2>
+<p> Meister is our own webserver, running <a
+href="http://www.php.net">PHP</a>-scripts and serving static pages for our
+dear customers. </p>
+
+<h2>Red Chief</h2>
+<p> Red Chief is our proxy, responsible for keeping control of our network and
+keeping our internal network safe from bad and evil stuff. </p>
+
+
+<h2>System specification</h2>
+<p>
+A more detailed system specification is available as pdf <a href="sysspec-1.pdf">here</a>.
+</p>
+
+</page>
diff --git a/tests/documents/worklog.xml b/tests/documents/worklog.xml
new file mode 100644
index 00000000..4f6007fb
--- /dev/null
+++ b/tests/documents/worklog.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<page title="Worklog - what we've done so far">
+
+<progresstable>
+<progress week="4,5">
+<!-- Sys. des Test des. Sälj cli. Adm. cli. Proxy -->
+ <st> 95</st><st> 5</st><st> 0</st><st> 0</st><st> 0</st>
+<!-- Sale serv. Fab. serv. Komp. test Funk. text Syst. test -->
+ <st> 5</st><st> 90</st><st> 0</st><st> 0</st><st> 0</st>
+</progress>
+<progress week="6">
+ <st>100</st><st> 5</st><st> 0</st><st> 0</st><st> 1</st>
+ <st> 5</st><st>90</st><st> 0</st><st> 0</st><st> 0</st>
+</progress>
+</progresstable>
+
+<week num="4, 5">
+ <what who="janlert, nikke, stric">
+ <p> We do some planing, resulting in a System specification.</p>
+ </what>
+
+ <what who="janlert, nikke, stric">
+ <p>
+ Waiting for the review of the system specification there's not much we can do.
+ we look into the different specifications and libraries we will use (
+ <a href="http://www.corba.org">CORBA</a>,
+ <a href="http://www.w3c.org/XML">XML</a>,
+ <a href="http://www.netscape.com/eng/ssl3/">SSL</a> etc).
+ </p>
+ </what>
+
+ <what who="janlert">
+ <p> Work is done on <a href="system.html">dotcom</a>, resulting in a mostly
+ working factory. Big fights with <a href="http://java.sun.com">java</a> to get
+ <a href="http://www.corba.org">CORBA</a> working ends up with a (temporary)
+ switch to <a href="http://www.pythong.org">python</a> for the <a
+ href="http://www.corba.org">CORBA</a> client part.
+ </p>
+ </what>
+
+ <what who="janlert">
+ <p>This web-page is set up (at least a first version).</p>
+ </what>
+</week>
+
+<week num="6">
+ <what who="janlert, nikke, stric">
+ <p>We got our design approved, and did some planning for a couple of hours,
+ we now have everything pretty much nailed down.</p>
+ </what>
+ <what who="stric">
+ <p>Some SSL work.</p>
+ </what>
+</week>
+
+<!--
+<week num="">
+<what who="">
+<p></p>
+</what>
+</week>
+-->
+
+</page>