You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nick <go...@muss.cis.mcmaster.ca> on 2004/06/29 17:18:10 UTC
Cocoon 2.1.5 incompatibilities with TEI Stylesheets
<>Hi everybody,
<>
<>I need some help, please<>.
<>
<>I am trying to transform a TEI document into HTML and PDF documents
using "native" XSL style sheets from
http://www.tei-c.org/Stylesheets/teixsl.html <http://www.tei-c.org/>.
These style sheets are composed of one main (teihtml.xsl) that uses
<xsl:include> and <xsl:import> and a whole bunch of other XSL modules
that handle all possible TEI tags.<>
<>
<>Those style sheets work perfectly fine with a regular browser. At the
point when I try to use the main style sheet within a pipeline all sorts
of troubles occur. Originally, the XSLT transformer would generate empty
output (without producing any errors). After I changed all the
xsl:include and xsl:import statements in teihtml.xsl to use cocoon
protocol (with href parameter) the pipeline produced some kind of the
result, namely <>XML file that is produced by the generator. This output
contains no XML tags, some XSL tags that should not be there and without
any HTML tags.<>
<>
<>Can somebody help me with solving this problem or share the
information about how to integrate existing TEI style sheets to be used
with Cocoon 2.1.5?
Thank you,
Sincerely
Nick
<>+==========================================+
<>Cocoon pipeline output:<> <>
<>
<>XSL style sheets for TEI XML Sebastian Rahtz January 27th 2003
Sebastian Rahtzversion 3.1 November 17th 2003 Sebastian Rahtzversion 3.0
September 17th 2003 Sebastian Rahtzversion 2.1 June 6th 2003 Sebastian
Rahtzversion 2.0 May 8th 2003 Sebastian Rahtzversion 1.5 April 14th 2003
Sebastian Rahtzversion 1.4 December 4th 2002 Sebastian Rahtzversion 1.3
October 3rd 2002 Sebastian Rahtzversion 1.2 Sept 14th 2002 Sebastian
Rahtzversion 1.1 August 11th 2002 Sebastian RahtzStart versioning family
and update documentation May 18th 2002 Sebastian RahtzMany changes to
stylesheets October 27th 2001Sebastian RahtzMany changes to the TEI as
applications come along. In the main, the setup has been used on `new'
documents, ie <>
<>...
<>variable empty to assert `false'. How does this work in practice? Here
is a real wrapper style </xsl:template> <xsl:param
name="useIDs"></xsl:param> <xsl:template name="copyrightStatement">
Copyright TEI 1995 </xsl:template> </xsl:stylesheet> You can see the
results at , the TEI Lite specification. The CSS file The following
table lists all the CSS `class' attributes used in HTML output; you can
change all of these in the associated .css file: boxParagraph of type
`box' departmentName of department in main page title epigraphdiv
containing an epigraph framelogoLink to logo file framemenuBody of frame
containing menu framemenudepartmentDepartment name in menu
frame framemenuinstitutionInstitutional name
<>+=================================================+
<>
<>
<>
<>Expected output (same stylesheet applied to the same XML file with
Cooktop 2.5):
<>
<html lang="en" xmlns:tei="http://www.tei-c.org/ns/1.0">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>XSL stylesheets for TEI XML</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/tei-oucs.css">
<meta name="author" content="Sebastian Rahtz">
<meta name="generator" content="Text Encoding Initiative Consortium XSLT
stylesheets">
<meta name="DC.Title" content="XSL stylesheets for TEI XML">
<meta name="DC.Type" content="Text">
<meta name="DC.Format" content="text/html">
</head>
<body><a name="TOP"></a><table class="header" width="100%">
<tr><td rowspan="3"><a target="_top" href="http://www.ox.ac.uk/"><img
border="0" width="78" height="94" src="/images/ncrest.gif" alt="Oxford
University"></a></td>
<td align="left">
<h2 class="institution">My Institution</h2>
</td></tr>
<tr><td align="left">
<h1 class="maintitle">XSL stylesheets for TEI XML</h1>
</td></tr>
</table>
<hr>
<h2>Contents</h2>
<ul class="toc">
...
<div class="teidiv">
<h2><a name="body.1_div.1"></a>1. Introduction</h2>
<p><a name="IDAAPUQ"></a>
This is a set of XSLT specifications to transform TEI XML
documents to HTML, and to XSL Formatting Objects.
It concentrates on TEI Lite, but adding support
for other modules is fairly easy, and I am working my way through the
TEI as applications come along. In the main, the setup has been
used on `new' documents, ie reports and web pages that I have
authored from scratch, rather than traditional TEI-encoded
existing material.
</p>
<p><a name="IDABPUQ"></a>This is release 3.1. There is a <a
href="ChangeLog" class="quicklink" target="_top">change log</a>
file available.</p>
+=================================================+
<>XML file used for generation
<?xml version="1.0"?>
<TEI.2>
<teiHeader>
<fileDesc>
<titleStmt>
<title>XSL stylesheets for TEI XML</title>
<author>Sebastian Rahtz</author>
</titleStmt>
<publicationStmt>
<p> </p>
</publicationStmt>
<sourceDesc>
<p></p>
</sourceDesc>
</fileDesc>
<profileDesc>
</profileDesc>
<revisionDesc>
<list>
<item><date>January 27th 2003 </date><name>Sebastian
Rahtz</name>version 3.1</item>
<item><date>November 17th 2003 </date><name>Sebastian
Rahtz</name>version 3.0</item>
<item><date>September 17th 2003 </date><name>Sebastian
Rahtz</name>version 2.1</item>
<item><date>June 6th 2003 </date><name>Sebastian
Rahtz</name>version 2.0</item>
<item><date>May 8th 2003 </date><name>Sebastian
Rahtz</name>version 1.5</item>
<item><date>April 14th 2003 </date><name>Sebastian
...
+=============================================+
Pipeline:
<map:pipeline>
<map:match pattern="xtext/tei-html/common/*.xsl">
<map:read src="tei-html/common/{1}.xsl" mime-type="text/xml"/>
</map:match>
<map:match pattern="xtext/tei-html/html/*.xsl">
<map:read src="tei-html/html/{1}.xsl" mime-type="text/xml"/>
</map:match>
<map:match pattern="xtext">
<map:generate src="tei-sample.xml"/>
<map:transform src="tei-html/html/teihtml.xsl"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
+=============================================+
Main XSL stylesheet:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import
href="cocoon://TaporPortal/portal/coplets/mytools/xtext/tei-html/common/teicommon.xsl"/>
<xsl:import
href="cocoon://TaporPortal/portal/coplets/mytools/xtext/tei-html/html/teihtml-param.xsl"/>
<xsl:include
href="cocoon://TaporPortal/portal/coplets/mytools/xtext/tei-html/html/teihtml-bibl.xsl"/>
<xsl:include
href="cocoon://TaporPortal/portal/coplets/mytools/xtext/tei-html/html/teihtml-chunk.xsl"/>
<xsl:include
href="cocoon://TaporPortal/portal/coplets/mytools/xtext/tei-html/html/teihtml-corpus.xsl"/>
...
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon 2.1.5 incompatibilities with TEI Stylesheets
Posted by Joerg Heinicke <jo...@gmx.de>.
On 02.07.2004 17:02, Nick wrote:
>> Sounds like anything does not match but is handled by built-in
>> templates that just output text.
> Believe it or not, but the very same example worked just fine with
> cocoon 2.0.5 (originally I used Cocoon 2.1.4). Is there any was to
> figure out what those built in templates do and to disable them?
Don't know about the difference between 2.0.5 and 2.1.4, most probably
the Xalan version. But the newer Xalan (in 2.1.4) should be much more
stable and standard conform.
About built-in templates: This has nothing to do with Cocoon but with
the XSLT processor, here Xalan. Of course you can not disable them, they
are part of the spec: http://www.w3.org/TR/xslt#built-in-rule. You have
to live with them, but every hand-added template overwrites the
particular rules.
> The XSLT processor I use is Xalan (sorry I can't figure out what the
> version is) that comes with Cocoon 2.1.5. When I tried switching to
> Saxon - that's the output is the same.
What's your input of the TEI XSLT processing? Can you provide a test case?
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon 2.1.5 incompatibilities with TEI Stylesheets
Posted by Nick <go...@muss.cis.mcmaster.ca>.
Dear Joerg Heinicke,
Thank you very much for your reply.
>> <>I am trying to transform a TEI document into HTML and PDF documents
>> using "native" XSL style sheets from
>> http://www.tei-c.org/Stylesheets/teixsl.html <http://www.tei-c.org/>.
>> These style sheets are composed of one main (teihtml.xsl) that uses
>> <xsl:include> and <xsl:import> and a whole bunch of other XSL modules
>> that handle all possible TEI tags.<>
>>
>> <>Those style sheets work perfectly fine with a regular browser. At
>> the point when I try to use the main style sheet within a pipeline
>> all sorts of troubles occur. Originally, the XSLT transformer would
>> generate empty output (without producing any errors). After I changed
>> all the xsl:include and xsl:import statements in teihtml.xsl to use
>> cocoon protocol (with href parameter)
>
>
> No need for this
In case if I leave the teihtml.xsl style sheet intact, the output that I
receive is the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<em xmlns:tei="http://www.tei-c.org/ns/1.0"/>
The pipeline is unchanged and there are no other changes then modifying
path to the style sheet to use cocoon protocol
>> the pipeline produced some kind of the result, namely <>XML file that
>> is produced by the generator. This output contains no XML tags, some
>> XSL tags that should not be there and without any HTML tags.<>
>
>
> Sounds like anything does not match but is handled by built-in
> templates that just output text.
>
That is definitely an option. I had a similar problem when I was trying
to produce HTML tags and apply an XSL style sheet that matches on some
of those HTML tags and inserts new ones (one of the use cases might be
capturing a web page, getting, say, main table via html/body/table path
and adding it into a new page which would display a custom header).
Normally it would not provide me with the output that is required (fully
formatted HTML page), but rather with partial stripped down XML (some of
the textual content of the page) that was produced by the generator
without any XML, XSL or HTML tags.
I observed this kind of behavior when trying to go through the "fiery"
example form Carsten Ziegeler's book "Cocoon:building XML Applications"
that is located on page 95, chapter 4 Putting Cocoon to Work. In that
case page was generated successfully, but the transformation give never
worked. Later on I fixed this example by using <xsl:copy-of select...>
instead of <xsl:value-of select...>. But in that case it was an
extremely simple XSL.
Believe it or not, but the very same example worked just fine with
cocoon 2.0.5 (originally I used Cocoon 2.1.4). Is there any was to
figure out what those built in templates do and to disable them?
>> <>Can somebody help me with solving this problem or share the
>> information about how to integrate existing TEI style sheets to be
>> used with Cocoon 2.1.5?
>
>
> For a specfic use case I had even the DocBook stylesheets running in
> Cocoon, so I guess it's not a problem of TEI and not of Cocoon in
> general. But you might have a look at the endorsed libs problem.
> Furthermore it would be interesting to know the xslt processor you use.
>
The XSLT processor I use is Xalan (sorry I can't figure out what the
version is) that comes with Cocoon 2.1.5. When I tried switching to
Saxon - that's the output is the same.
Thank you very much.
Sincerely,
Nick.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon 2.1.5 incompatibilities with TEI Stylesheets
Posted by Joerg Heinicke <jo...@gmx.de>.
On 29.06.2004 17:18, Nick wrote:
> <>I am trying to transform a TEI document into HTML and PDF documents
> using "native" XSL style sheets from
> http://www.tei-c.org/Stylesheets/teixsl.html <http://www.tei-c.org/>.
> These style sheets are composed of one main (teihtml.xsl) that uses
> <xsl:include> and <xsl:import> and a whole bunch of other XSL modules
> that handle all possible TEI tags.<>
>
> <>Those style sheets work perfectly fine with a regular browser. At the
> point when I try to use the main style sheet within a pipeline all sorts
> of troubles occur. Originally, the XSLT transformer would generate empty
> output (without producing any errors). After I changed all the
> xsl:include and xsl:import statements in teihtml.xsl to use cocoon
> protocol (with href parameter)
No need for this.
> the pipeline produced some kind of the
> result, namely <>XML file that is produced by the generator. This output
> contains no XML tags, some XSL tags that should not be there and without
> any HTML tags.<>
Sounds like anything does not match but is handled by built-in templates
that just output text.
> <>Can somebody help me with solving this problem or share the
> information about how to integrate existing TEI style sheets to be used
> with Cocoon 2.1.5?
For a specfic use case I had even the DocBook stylesheets running in
Cocoon, so I guess it's not a problem of TEI and not of Cocoon in
general. But you might have a look at the endorsed libs problem.
Furthermore it would be interesting to know the xslt processor you use.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org