You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by di...@apache.org on 2005/10/08 04:51:12 UTC
svn commit: r307241 [1/2] - in
/forrest/trunk/main/webapp/resources/stylesheets: ./ aggregates/
Author: diwaker
Date: Fri Oct 7 19:51:03 2005
New Revision: 307241
URL: http://svn.apache.org/viewcvs?rev=307241&view=rev
Log:
Old stylesheets are still there. I'm just adding the renamed ones right now. Once we are sure everything works, we can remove the old ones.
Added:
forrest/trunk/main/webapp/resources/stylesheets/aggregates/book-to-cinclude.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/aggregates/docs-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/any-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/book-to-book-i18n.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/book-to-cinclude-lucene.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/changesv10-to-changesv11.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/directory-to-book.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/directory-to-i18n.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/directory-to-revisions.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/docv10-to-docv11.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv12.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv13.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/faq-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/faqv10-to-faqv11.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv12.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv13.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/howto-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/html-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/html-to-htmlbody.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/linkmap-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/lucene-search-to-xdoc.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/lucene-update-to-xdoc.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/page-to-html.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/plugins-to-xdoc.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/profile-to-html.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/profile-to-page.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/project-to-text.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/projectnavigation-to-site.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/rss-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/rssissues-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/site-to-book.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/site-to-site-normalizetabs.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/site-to-site-selectnode.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/text-to-document.xsl (with props)
forrest/trunk/main/webapp/resources/stylesheets/xdoc-to-lucene.xsl (with props)
Added: forrest/trunk/main/webapp/resources/stylesheets/aggregates/book-to-cinclude.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/aggregates/book-to-cinclude.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/aggregates/book-to-cinclude.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/aggregates/book-to-cinclude.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+Generates a skeleton doc-v20 file for the whole site with CInclude elements where content should be pulled in.
+Input is expected to be in standard book.xml format. @hrefs should be normalized, although unnormalized hrefs can be
+handled by uncommenting the relevant section.
+
+See http://127.0.0.1:8888/book-wholesite.html to see what the book xml looks like
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:cinclude="http://apache.org/cocoon/include/1.0">
+
+ <xsl:param name="title" select="''"/>
+ <xsl:param name="ignore" select="'jira-manual'"/>
+
+ <xsl:template match="book">
+ <document>
+ <header>
+ <title><xsl:value-of select="$title"/></title>
+ </header>
+ <body>
+ <xsl:apply-templates select="menu|menu-item"/>
+ </body>
+ </document>
+ </xsl:template>
+
+
+ <xsl:template match="menu[contains(@href, ':')]"/> <!-- Ignore all non-local links -->
+ <xsl:template match="menu[contains(@href, '/')]"/> <!-- Ignore directories -->
+ <xsl:template match="menu[not(contains(@href, '.'))]">
+ <section>
+ <title><xsl:value-of select="@label"/></title>
+ <xsl:apply-templates/>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="menu-item[@type='hidden']"/> <!-- Ignore hidden items -->
+ <xsl:template match="menu-item[contains(@href, '#')]"/> <!-- Ignore #frag-id items -->
+ <xsl:template match="menu-item[contains(@href, ':')]"/> <!-- Ignore all non-local links -->
+ <xsl:template match="menu-item[starts-with(@href, $ignore)]"/> <!-- Ignore the aggregated pages -->
+
+ <!-- Recursive template to collate @href's -->
+ <xsl:template name="absolute-href">
+ <xsl:param name="node"/>
+ <!-- Only append ancestor hrefs if we're not a http(s): URL -->
+ <xsl:if test="not(starts-with($node/@href, 'http:') or starts-with($node/@href, 'https:'))">
+ <xsl:if test="$node/../@href">
+ <xsl:call-template name="absolute-href">
+ <xsl:with-param name="node" select="$node/.."/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:value-of select="$node/@href"/>
+ </xsl:template>
+
+ <!-- normally directories are menus and files are menu-items,
+ but if 'menu' contained a '.' (then it didn't match the main 'menu' template above),
+ and it's probably a file (because the children menu-items are #fragments)
+ so we match now like a menu-item
+ -->
+ <xsl:template match="menu-item|menu">
+ <section class="page">
+ <xsl:attribute name="id">
+ <xsl:text></xsl:text><xsl:value-of select="@href"/>
+ </xsl:attribute>
+ <cinclude:include>
+ <xsl:attribute name="src">
+ <xsl:text>cocoon://</xsl:text>
+ <!-- This isn't necessary if reading source from cocoon://book-*.xml
+ <xsl:call-template name="absolute-href">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ -->
+ <xsl:value-of select="concat(substring-before(@href, '.'), '.xml')"/>
+ </xsl:attribute>
+ </cinclude:include>
+ </section>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/aggregates/book-to-cinclude.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:cinclude="http://apache.org/cocoon/include/1.0"
+ xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings"
+ exclude-result-prefixes="cinclude">
+
+ <xsl:include href="../external/str.find-last.xslt"/>
+
+ <xsl:key name="node-id" match="*" use="@id"/>
+
+ <!-- If we encounter a section with an @id, make that @id globally unique by
+ prefixing the id of the current document -->
+ <xsl:template match="section/document//@id">
+ <xsl:attribute name="id"><xsl:value-of select="concat(ancestor::section/@id, '#', .)"/></xsl:attribute>
+ </xsl:template>
+
+ <!-- Make #fragment-id references inside each page globally unique -->
+ <xsl:template match="section/document//link/@href[starts-with(., '#')]">
+ <xsl:attribute name="href"><xsl:value-of select="concat('#', ancestor::section/@id, .)"/></xsl:attribute>
+ </xsl:template>
+
+ <!-- Translate relative links to '#link' -->
+ <xsl:template match="section/document//link/@href[not(starts-with(., 'http:') or starts-with(., 'https:'))]">
+ <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="section/document//figure|img[starts-with(@src, 'my-images')]">
+ <!-- fix my-images/** links, which break as they are not relative to the site root -->
+ <xsl:variable name="page-root">
+ <xsl:call-template name="str:substring-before-last">
+ <xsl:with-param name="input" select="ancestor::section/@id"/>
+ <xsl:with-param name="substr" select="'/'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:copy>
+ <xsl:attribute name="src">
+ <xsl:value-of select="concat($page-root,'/',@src)"/>
+ </xsl:attribute>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:include href="../copyover.xsl"/>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/aggregates/doc-to-doc-uniqueids.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/aggregates/docs-to-document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/aggregates/docs-to-document.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/aggregates/docs-to-document.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/aggregates/docs-to-document.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="section/document">
+ <title><xsl:value-of select="header/title"/></title>
+ <xsl:copy-of select="body/node()" />
+ </xsl:template>
+
+ <xsl:include href="../copyover.xsl"/>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/aggregates/docs-to-document.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/any-to-document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/any-to-document.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/any-to-document.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/any-to-document.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,247 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method = "xml"
+ version="1.0"
+ omit-xml-declaration="no"
+ indent="no"
+ encoding="ISO-8859-1"
+ doctype-system="document-v11.dtd"
+ doctype-public="-//APACHE//DTD Documentation V1.1//EN" />
+
+ <xsl:template match="/">
+ <xsl:choose>
+ <xsl:when test="name(child::node())='document'">
+ <xsl:apply-templates/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <document>
+ <header><title>Error in conversion</title></header>
+ <body>
+ <warning>This file is not in anakia format, please convert manually.</warning>
+ </body>
+ </document>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="document">
+ <document>
+ <xsl:apply-templates/>
+ </document>
+ </xsl:template>
+
+ <!-- properties to header -->
+ <xsl:template match="properties">
+ <header>
+ <xsl:apply-templates/>
+ <authors>
+ <xsl:for-each select = "author">
+ <person email="{@email}" name="{.}"/>
+ </xsl:for-each>
+ </authors>
+ </header>
+ </xsl:template>
+
+ <xsl:template match="P|p">
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <xsl:template match="figure">
+ <figure alt="{title}" src= "{graphic/@fileref}" />
+ </xsl:template>
+
+ <xsl:template match="img">
+ <xsl:choose>
+ <xsl:when test="name(..)='section'">
+ <figure alt="{@alt}" src= "{@src}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <img alt="{@alt}" src= "{@src}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+ </xsl:template>
+
+ <xsl:template match="source|blockquote">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <code>
+ <xsl:value-of select="." />
+ </code>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <source>
+ <xsl:value-of select="." />
+ </source>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- person to author -->
+ <xsl:template match="author"/>
+
+ <xsl:template match="section|s1|s2|s3|s4|s5|s6">
+ <section>
+ <title><xsl:value-of select="@name" /></title>
+ <xsl:apply-templates/>
+ </section>
+ </xsl:template>
+
+
+ <xsl:template match="subsection">
+ <section>
+ <title><xsl:value-of select="@name" /></title>
+ <xsl:apply-templates/>
+ </section>
+ </xsl:template>
+
+ <!-- convert a to link -->
+ <xsl:template match="a">
+ <xsl:if test="@name">
+ <!-- Attach an id to the current node -->
+ <xsl:attribute name="id"><xsl:value-of select="translate(@name, ' $', '__')"/></xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:if>
+ <xsl:if test="@href">
+ <link href="{@href}">
+ <xsl:apply-templates/>
+ </link>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="@valign | @align"/>
+
+ <xsl:template match="center">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:apply-templates/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="ol">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:text disable-output-escaping="yes"><![CDATA[</p>]]></xsl:text>
+ <ol>
+ <xsl:apply-templates/>
+ </ol>
+ <xsl:text disable-output-escaping="yes"><![CDATA[<p>]]></xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <ol>
+ <xsl:apply-templates/>
+ </ol>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="ul">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:text disable-output-escaping="yes"><![CDATA[</p>]]></xsl:text>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ <xsl:text disable-output-escaping="yes"><![CDATA[<p>]]></xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="b">
+ <strong>
+ <xsl:value-of select = "."/>
+ </strong>
+ </xsl:template>
+
+ <xsl:template match="i">
+ <em>
+ <xsl:value-of select = "."/>
+ </em>
+ </xsl:template>
+
+ <xsl:template match="table">
+ <table>
+ <xsl:apply-templates select="node()"/>
+ </table>
+ </xsl:template>
+
+
+ <xsl:template match="br">
+ <xsl:choose>
+ <xsl:when test="normalize-space(text())">
+
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:apply-templates/>
+ <br/>
+ </xsl:when>
+ <xsl:otherwise>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:otherwise>
+ <br/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Strip -->
+ <xsl:template match="font">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="h1|h2|h3|h4">
+ <xsl:comment> -ATTENTION- THIS IS A SECTION, PLEASE ENCLOSE THE SECTION CONTENTS... -ATTENTION- </xsl:comment>
+ <section><title><xsl:apply-templates/></title> <xsl:comment>... HERE! :-)</xsl:comment></section>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*"/>
+ </xsl:copy>
+ </xsl:template>
+
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/any-to-document.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/book-to-book-i18n.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/book-to-book-i18n.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/book-to-book-i18n.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/book-to-book-i18n.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!--+
+ | Add i18n tags so it can be processed.
+ +-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
+
+ <xsl:import href="copyover.xsl"/>
+
+ <xsl:template match="@label">
+ <xsl:attribute name="i18n:attr">label</xsl:attribute>
+ <xsl:attribute name="label">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <!-- FIXME: Need support for more than one attribute
+ <xsl:template match="@description">
+ <xsl:attribute name="i18n:attr">description</xsl:attribute>
+ <xsl:attribute name="description">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ <xsl:apply-templates />
+ </xsl:template>
+ -->
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/book-to-book-i18n.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/book-to-cinclude-lucene.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/book-to-cinclude-lucene.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/book-to-cinclude-lucene.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/book-to-cinclude-lucene.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+Generates a lucene:index for the whole site with CInclude elements where lucene:documents should be pulled in.
+Input is expected to be in standard book.xml format. @hrefs should be normalized, although unnormalized hrefs can be
+handled by uncommenting the relevant section.
+-->
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:cinclude="http://apache.org/cocoon/include/1.0"
+ xmlns:lucene="http://apache.org/cocoon/lucene/1.0">
+
+ <!-- Java class name of the Lucene analyzer to be used -->
+ <xsl:param name="analyzer"/>
+
+ <!-- Directory where the lucene index will be created (relative to
+ Forrest working directory as determined by servlet engine) -->
+ <xsl:param name="directory"/>
+
+ <!-- Should the index be updated if it already exists? If false and
+ the index already exists, the index is re-created, and the original
+ index is discarded. -->
+ <xsl:param name="update-index"/>
+
+ <!-- Index merge factor (see Lucene documentation) -->
+ <xsl:param name="merge-factor"/>
+
+ <!-- The extension of the lucene index fragments. -->
+ <xsl:param name="extension" select="'lucene'"/>
+
+
+ <!-- Creates the lucene:index root element from the Forrest
+ book. -->
+ <xsl:template match="book">
+ <lucene:index analyzer="{$analyzer}"
+ directory="{$directory}"
+ create="{not(boolean($update-index))}"
+ merge-factor="{$merge-factor}">
+ <xsl:apply-templates select="menu|menu-item"/>
+ </lucene:index>
+ </xsl:template>
+
+ <!-- Recursively processes menu elements. -->
+ <xsl:template match="menu">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="menu-item[@type='hidden']"/> <!-- Ignore hidden items -->
+ <xsl:template match="menu-item[contains(@href, '#')]"/> <!-- Ignore #frag-id items -->
+ <xsl:template match="menu-item[starts-with(@href, 'http:')]"/> <!-- Ignore absolute http urls -->
+ <xsl:template match="menu-item[starts-with(@href, 'https:')]"/> <!-- Ignore absolute https urls -->
+
+ <!-- For entries whose @href ends in "/", refer to @href/index.lucene -->
+ <xsl:template match="menu-item[substring(@href, string-length(@href) - string-length('/') + 1) = '/']">
+ <cinclude:include>
+ <xsl:attribute name="src">
+ <xsl:text>cocoon://</xsl:text>
+ <xsl:value-of select="concat(@href, 'index.', $extension)"/>
+ </xsl:attribute>
+ </cinclude:include>
+ </xsl:template>
+
+ <!-- Inserts a cinclude:include element for document referenced by
+ menu item. -->
+ <xsl:template match="menu-item">
+ <cinclude:include>
+ <xsl:attribute name="src">
+ <xsl:text>cocoon://</xsl:text>
+ <xsl:call-template name="strip-extension">
+ <xsl:with-param name="the-string" select="@href"/>
+ </xsl:call-template>
+ <xsl:value-of select="$extension"/>
+ </xsl:attribute>
+ </cinclude:include>
+ </xsl:template>
+
+ <!-- Strips the extension from a filename. Works for filenames with
+ multiple dots. -->
+ <xsl:template name="strip-extension">
+ <xsl:param name="the-string"/>
+ <xsl:value-of select="substring-before($the-string, '.')"/>
+ <xsl:if test="substring-after($the-string, '.') != ''">
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="strip-extension">
+ <xsl:with-param name="the-string" select="substring-after($the-string, '.')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/book-to-cinclude-lucene.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/changesv10-to-changesv11.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/changesv10-to-changesv11.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/changesv10-to-changesv11.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/changesv10-to-changesv11.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:preserve-space elements="*" />
+ <!-- changes-v10.dtd to changes-v11.dtd transformation -->
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="changes/@title">
+ <title><xsl:value-of select="."/></title>
+ </xsl:template>
+
+ <xsl:template match="link/@type | link/@actuate | link/@show |
+ jump/@type | jump/@actuate | jump/@show |
+ fork/@type | fork/@actuate | fork/@show"/>
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/changesv10-to-changesv11.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/directory-to-book.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/directory-to-book.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/directory-to-book.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/directory-to-book.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+
+<!-- Converts the output of the DirectoryGenerator to Forrest's book.xml
+format. Typically this would be used to define a book.xml pipeline for a
+specific page. Eg, in menu.xmap, define the DirectoryGenerator:
+
+<map:generators default="file">
+ <map:generator name="directory" src="org.apache.cocoon.generation.DirectoryGenerator" />
+</map:generators>
+
+And then define the book.xml matcher for a directory that you want to
+automatically generate a menu for (here wiki/):
+
+<map:match pattern="wiki/**book-*">
+ <map:generate type="directory" src="content/xdocs/wiki/{1}">
+ <map:parameter name="dateFormat" value="yyyy-MM-dd hh:mm" />
+ <map:parameter name="depth" value="5" />
+ <map:parameter name="exclude" value="[.][^x[^m][^l]|~$|^my-images$" />
+ </map:generate>
+ <map:transform src="resources/stylesheets/directory2book.xsl" />
+ <map:serialize type="xml"/>
+</map:match>
+
+Alternatively, the XPathDirectoryGenerator can be used to include some page
+metadata (label, meta attributes) in the XML, and the directory listing can
+then be sorted by an XPath expression specified in the sitemap:
+
+<map:match pattern="(.*)(dir1|dir2|dir3)/book-(.*)" type="regexp">
+ <map:generate label="debug" src="content/xdocs/{1}{2}"
+type="xpathdirectory">
+ <map:parameter name="depth" value="2"/>
+ <map:parameter name="xpath" value="/document/header/meta |
+/document/header/title"/>
+ </map:generate>
+ <map:transform src="resources/stylesheets/directory2book.xsl">
+ <map:parameter name="sort-order" value="descending"/>
+ <map:parameter name="sort-select" value="dir:xpath/meta[@name='date']"/>
+ </map:transform>
+ <map:serialize type="xml"/>
+</map:match>
+-->
+
+<xsl:stylesheet exclude-result-prefixes="dir" version="1.0"
+ xmlns:dir="http://apache.org/cocoon/directory/2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dyn="http://exslt.org/dynamic">
+ <xsl:import href="../../skins/common/xslt/html/pathutils.xsl"/>
+ <xsl:output doctype-public="-//APACHE//DTD Cocoon Documentation Book V1.0//EN" doctype-system="book-cocoon-v10.dtd"/>
+
+ <xsl:param name="served-extension" select="'html'"/>
+ <xsl:param name="sort-order" select="'ascending'"/>
+ <xsl:param name="sort-case-order" select="'upper-first'"/>
+ <xsl:param name="sort-select" select="'.'"/>
+
+ <xsl:template match="/">
+ <book copyright="" software="" title="">
+ <!--
+ <menu label="Aggregates">
+ <menu-item label="Combined content" href="combined.html"/>
+ </menu>
+ -->
+ <xsl:apply-templates/>
+ </book>
+ </xsl:template>
+
+ <xsl:template match="dir:directory">
+ <menu label="{translate(@name,'-_',' ')}">
+ <xsl:apply-templates select="dir:file">
+ <xsl:sort case-order="{$sort-case-order}" order="{$sort-order}" select="dyn:evaluate($sort-select)"/>
+ </xsl:apply-templates>
+ </menu>
+ <xsl:apply-templates select="dir:directory [descendant::dir:file]"/>
+ </xsl:template>
+
+ <xsl:template match="dir:file">
+ <!-- name without extension -->
+ <xsl:variable name="corename">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="@name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- indirection to allow get-label overriding -->
+ <xsl:variable name="label">
+ <xsl:call-template name="get-label">
+ <xsl:with-param name="corename" select="$corename"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- empty label means side menu item inexistence -->
+ <xsl:if test="$label != ''">
+ <menu-item label="{$label}">
+ <xsl:attribute name="href">
+ <xsl:variable name="path"/>
+ <xsl:for-each select="ancestor::dir:directory [not (position()=last())]">
+ <xsl:variable name="path" select="concat($path, @name, '/')"/>
+ <xsl:value-of select="$path"/>
+ </xsl:for-each>
+ <!-- indirection to allow get-href overriding -->
+ <xsl:call-template name="get-href">
+ <xsl:with-param name="corename" select="$corename"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </menu-item>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- override this to your needs. For example, see xpathdirectory2book.xsl -->
+ <xsl:template name="get-label">
+ <xsl:param name="corename"/>
+ <xsl:value-of select="translate($corename,'-_',' ')"/>
+ </xsl:template>
+
+ <xsl:template name="get-href">
+ <xsl:param name="corename"/>
+ <xsl:value-of select="concat($corename, '.', $served-extension)"/>
+ </xsl:template>
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/directory-to-book.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/directory-to-i18n.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/directory-to-i18n.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/directory-to-i18n.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/directory-to-i18n.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+ Create a div element with all the alternate language versions.
+-->
+
+<xsl:stylesheet exclude-result-prefixes="dir" version="1.0"
+ xmlns:dir="http://apache.org/cocoon/directory/2.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+
+ <xsl:param name="ext" />
+
+ <xsl:template match="/">
+ <div class="lang" >
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="dir:file">
+ <!-- Assume that the file pattern is resource_locale.extension -->
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat(substring-before(@name,'_'),'.',$ext)"/>
+ </xsl:attribute >
+ <xsl:attribute name="hreflang">
+ <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
+ </xsl:attribute >
+ <xsl:attribute name="lang">
+ <!-- It just specify that the content on "a" element is in this language -->
+ <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
+ </xsl:attribute >
+ <xsl:attribute name="rel">
+ <xsl:value-of select="'alternate'"/>
+ </xsl:attribute>
+ <xsl:attribute name="i18n:attr">title</xsl:attribute>
+ <xsl:attribute name="title" >
+ <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
+ </xsl:attribute>
+ <i18n:text i18n:catalogue="langcode">
+ <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
+ </i18n:text>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/directory-to-i18n.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/directory-to-revisions.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/directory-to-revisions.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/directory-to-revisions.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/directory-to-revisions.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dir="http://apache.org/cocoon/directory/2.0">
+
+
+ <xsl:param name="page" />
+ <xsl:variable name="revisionPage"><xsl:value-of select="concat('revision-',$page)" /></xsl:variable>
+
+ <xsl:template match="dir:directory">
+ <revisions>
+ <xsl:apply-templates select="dir:file" />
+ </revisions>
+ </xsl:template>
+
+ <xsl:template match="dir:file">
+
+ <xsl:if test="starts-with(@name,$revisionPage)" >
+ <revision>
+ <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+ <xsl:attribute name="date"><xsl:value-of select="@date"/></xsl:attribute>
+ </revision>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/directory-to-revisions.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/docv10-to-docv11.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/docv10-to-docv11.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/docv10-to-docv11.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/docv10-to-docv11.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- <xsl:preserve-space elements="*" /> -->
+ <!-- document-v10.dtd to document-v11.dtd transformation -->
+
+
+ <!-- We should something similar, i.e. make sure the result of this transformation is validated against the v11 DTD
+ -->
+ <xsl:template match="/">
+ <xsl:choose>
+ <xsl:when test="document">
+ <!-- there exists a document element -->
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- no document element, presumably no header also, so I will generate one -->
+ <document>
+ <header>
+ <title><xsl:value-of select="s1[1]/@title"/></title>
+ <authors><person name="unknown" email="unknown"/></authors>
+ </header>
+ <body>
+ <xsl:choose>
+ <xsl:when test="count(s1)='1'">
+ <!-- only one s1 in the entire document, must be a hack to create a title -->
+ <xsl:choose>
+ <xsl:when test="count(s1/s2)='1'">
+ <!-- only one s2 inside that s1, unwrap the content of that s2 -->
+ <xsl:apply-templates select="s1/s2/*"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- in any case, we get rid of these s1/s2 elements -->
+ <xsl:apply-templates select="s1/*"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </body>
+ </document>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- no links allowed in em anymore -->
+ <xsl:template match="em[link]">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!-- fixes sections -->
+ <xsl:template match="s1 | s2 | s3 | s4">
+ <section>
+ <xsl:apply-templates select="@*[name()!='title']"/>
+ <xsl:apply-templates select="@*[name()='title']"/>
+ <!-- apply title rule last. See http://sourceforge.net/forum/forum.php?thread_id=729070&forum_id=94027 -->
+ <xsl:apply-templates select="node()"/>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="s1/@title | s2/@title | s3/@title | s4/@title">
+ <title><xsl:value-of select="."/></title>
+ </xsl:template>
+
+ <!-- dunnow what to do with connect - maybe just evaporize it? -->
+ <xsl:template match="connect">
+ <xsl:message terminate="no">The connect element isn't supported anymore in the document-v11.dtd, please fix your document.</xsl:message>
+ [[connect: <xsl:apply-templates/> ]]
+ </xsl:template>
+
+ <xsl:template match="link/@idref">
+ <xsl:message terminate="no">The link element has no idref attribute defined in the document-v11.dtd, please fix your document.</xsl:message>
+ [[link/@idref: <xsl:apply-templates/> ]]
+ </xsl:template>
+
+ <xsl:template match="link/@type | link/@actuate | link/@show |
+ jump/@type | jump/@actuate | jump/@show |
+ fork/@type | fork/@actuate | fork/@show"/>
+
+ <!-- 'simple lists' become unordered lists -->
+ <xsl:template match="sl">
+ <ul>
+ <xsl:apply-templates select="@*|node()"/>
+ </ul>
+ </xsl:template>
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/docv10-to-docv11.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv12.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv12.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv12.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv12.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- document-v20x.dtd to document-v12.dtd transformation -->
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="a">
+ <link>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="node()"/>
+ </link>
+ </xsl:template>
+
+ <!--
+ <xsl:template match="s1/@title | s2/@title | s3/@title | s4/@title">
+ <title><xsl:value-of select="."/></title>
+ </xsl:template>
+ -->
+
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv12.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv13.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv13.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv13.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv13.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <!-- document-v20.dtd to document-v13.dtd transformation -->
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="a">
+ <link>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="node()"/>
+ </link>
+ </xsl:template>
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/docv20-to-docv13.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/faq-to-document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/faq-to-document.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/faq-to-document.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/faq-to-document.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:import href="copyover.xsl"/>
+
+ <xsl:template match="faqs">
+ <document>
+ <header>
+ <title><xsl:value-of select="@title"/></title>
+ </header>
+ <body>
+ <section>
+ <title>Questions</title>
+ <xsl:apply-templates select="faq|part"/>
+ </section>
+ </body>
+ </document>
+ </xsl:template>
+
+ <xsl:template match="part" mode="index">
+ <li>
+ <strong>
+ <!-- Rely on <ol> numbering here -->
+ <!--<xsl:number level="multiple" count="faq|part" format="1.1. "/> -->
+ <xsl:apply-templates select="title"/></strong>
+ <ul>
+ <xsl:apply-templates select="faq|part" mode="index"/>
+ </ul><br />
+ </li>
+ </xsl:template>
+
+ <xsl:template match="faq" mode="index">
+ <li>
+ <xsl:attribute name="id">
+ <xsl:call-template name="generate-id"/><xsl:text>-menu</xsl:text>
+ </xsl:attribute>
+ <link>
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
+ </xsl:attribute>
+ <!--
+ IMHO adding this makes the tightly-packed menu less legible for
+ little benefit (JT)
+ <xsl:number level="multiple" count="faq|part" format="1.1. "/>
+ -->
+ <xsl:apply-templates select="question" mode="index"/>
+ </link>
+ </li>
+ </xsl:template>
+
+ <xsl:template match="part">
+ <xsl:variable name="id">
+ <xsl:call-template name="generate-id"/>
+ </xsl:variable>
+ <section id="{$id}">
+ <title>
+ <xsl:number level="multiple" count="faq|part" format="1.1. "/>
+ <xsl:value-of select="title"/>
+ </title>
+ <xsl:apply-templates select="faq|part"/>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="faq">
+ <xsl:variable name="id">
+ <xsl:call-template name="generate-id"/>
+ </xsl:variable>
+
+ <section id="{$id}">
+ <title>
+ <xsl:number level="multiple" count="faq|part" format="1.1. "/>
+ <xsl:apply-templates select="question"/>
+ </title>
+ <xsl:apply-templates select="answer"/>
+ </section>
+ </xsl:template>
+
+ <xsl:template name="generate-id">
+ <xsl:choose>
+ <xsl:when test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(concat(local-name(.), '-'), generate-id(.))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="question" mode="index">
+ <xsl:apply-templates select="node()[not(local-name()='elaboration')]"/>
+ </xsl:template>
+
+ <xsl:template match="question">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="answer">
+ <xsl:if test="count(p)>0">
+ <xsl:apply-templates/>
+ </xsl:if>
+ <xsl:if test="count(p)=0">
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="title">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/faq-to-document.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/faqv10-to-faqv11.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/faqv10-to-faqv11.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/faqv10-to-faqv11.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/faqv10-to-faqv11.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:preserve-space elements="*" />
+ <!-- faq-v10.dtd to faq-v11.dtd transformation -->
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="link/@idref">
+ <xsl:message terminate="no">The link element has no idref attribute defined in the document-v11.dtd, please fix your document.</xsl:message>
+ [[link/@idref: <xsl:value-of select="."/> ]]
+ </xsl:template>
+
+ <xsl:template match="link/@type | link/@actuate | link/@show |
+ jump/@type | jump/@actuate | jump/@show |
+ fork/@type | fork/@actuate | fork/@show"/>
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/faqv10-to-faqv11.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv12.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv12.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv12.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv12.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:preserve-space elements="*" />
+ <!-- faq-v20x.dtd to faq-v12.dtd transformation -->
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="faqs">
+ <faqs>
+ <xsl:attribute name="title">
+ <xsl:value-of select="title"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </faqs>
+ </xsl:template>
+
+ <xsl:template match="faqs/title"/>
+
+ <xsl:template match="faqsection">
+ <part>
+ <xsl:apply-templates select="node()|@*"/>
+ </part>
+ </xsl:template>
+
+ <xsl:template match="a">
+ <link>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="node()"/>
+ </link>
+ </xsl:template>
+
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv12.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv13.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv13.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv13.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv13.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:preserve-space elements="*" />
+ <!-- faq-v20x.dtd to faq-v13.dtd transformation -->
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="faqs">
+ <faqs>
+ <xsl:attribute name="title">
+ <xsl:value-of select="title"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </faqs>
+ </xsl:template>
+
+ <xsl:template match="faqs/title"/>
+
+ <xsl:template match="faqsection">
+ <part>
+ <xsl:apply-templates select="node()|@*"/>
+ </part>
+ </xsl:template>
+
+ <xsl:template match="a">
+ <link>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="node()"/>
+ </link>
+ </xsl:template>
+
+
+ <!-- the obligatory copy-everything -->
+ <xsl:template match="node() | @*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/faqv20-to-faqv13.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/howto-to-document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/howto-to-document.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/howto-to-document.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/howto-to-document.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,167 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:import href="copyover.xsl"/>
+
+ <!-- Processing a raw howto without revisions -->
+ <xsl:template match="/howto">
+ <document>
+ <xsl:copy-of select="header"/>
+ <body>
+ <xsl:apply-templates select="*[not(name()='header')]"/>
+ </body>
+ </document>
+ </xsl:template>
+
+ <!-- Processing a howto combined with revisions -->
+ <xsl:template match="/all">
+ <document>
+ <xsl:copy-of select="howto/header"/>
+ <body>
+ <xsl:apply-templates select="howto"/>
+ <xsl:apply-templates select="revisions"/>
+ </body>
+ </document>
+ </xsl:template>
+
+ <xsl:template match="howto">
+ <xsl:if test="normalize-space(header/abstract)!=''">
+ <xsl:apply-templates select="header/abstract"/>
+ </xsl:if>
+ <xsl:apply-templates select="*[not(name()='header')]"/>
+ </xsl:template>
+
+ <xsl:template match="howto/header/abstract">
+ <section id="Overview">
+ <title>Overview</title>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="purpose | prerequisites | audience | steps | extension | tips | references | feedback">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="normalize-space(@title)!=''">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="name()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <section id="{$title}">
+ <title><xsl:value-of select="$title"/></title>
+ <xsl:apply-templates/>
+ </section>
+ </xsl:template>
+
+ <!-- new faqs format - mostly borrowed from other sections -->
+ <xsl:template match="faqs">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="normalize-space(title)!=''">
+ <xsl:apply-templates select="title"/>
+ </xsl:when>
+ <xsl:when test="normalize-space(@title)!=''">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="name()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <section id="{$title}">
+ <title><xsl:value-of select="$title"/></title>
+ <xsl:apply-templates select="faq"/>
+ <xsl:apply-templates select="faqsection | part"/>
+ </section>
+ </xsl:template>
+
+ <!-- an actual faq is composed of a question and answer -->
+ <xsl:template match="faq">
+ <section>
+ <xsl:apply-templates select="question"/>
+ <xsl:apply-templates select="answer"/>
+ </section>
+ </xsl:template>
+
+ <!-- numbering a faqsection and adding to the title
+ FIXME: maybe an ID should be written out -->
+ <xsl:template match="faqsection | part">
+ <section>
+ <title>
+ <xsl:number count="faqsection | part" level="multiple" format="1.1.1 "/>
+ <xsl:value-of select="normalize-space(title)"/>
+ </title>
+ <xsl:apply-templates select="faq"/>
+ <xsl:apply-templates select="faqsection | part"/>
+ </section>
+ </xsl:template>
+
+ <!-- numbering the question
+ FIXME: maybe an ID of questnnn should be written out -->
+ <xsl:template match="question">
+ <title>
+ <xsl:number count="faqsection | part" level="multiple" format="1.1.1."/>
+ <xsl:number count="faq" level="single" format="1 "/>
+ <xsl:value-of select="normalize-space(.)"/>
+ </title>
+ <xsl:apply-templates select="answer"/>
+ </xsl:template>
+
+ <!-- borrowed from the current faqs stylesheet -->
+ <xsl:template match="answer">
+ <xsl:if test="count(p)>0">
+ <xsl:apply-templates/>
+ </xsl:if>
+ <xsl:if test="count(p)=0">
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="revisions">
+ <section id="revisions">
+ <title>Revisions</title>
+ <p>
+ Find a problem with this document? Consider contacting the mailing lists or
+ submitting your own revision. For instructions, read the How To Submit a Revision.
+ </p>
+ <xsl:if test="revision">
+ <ul>
+ <xsl:apply-templates select="revision"/>
+ </ul>
+ </xsl:if>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="revision">
+ <xsl:variable name="href"><xsl:value-of select="concat(substring-before(@name,'.xml'),'.html')" /></xsl:variable>
+ <li>Revision, <link href="{ $href}"><xsl:value-of select="@date"/></link></li>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/howto-to-document.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/html-to-document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/html-to-document.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/html-to-document.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/html-to-document.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,315 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:key name="h2s" match="h2" use="generate-id(preceding-sibling::h1[1])"/>
+ <xsl:key name="h3s" match="h3" use="generate-id(preceding-sibling::h2[1])"/>
+ <xsl:key name="h4s" match="h4" use="generate-id(preceding-sibling::h3[1])"/>
+ <xsl:key name="h5s" match="h5" use="generate-id(preceding-sibling::h4[1])"/>
+ <xsl:key name="h6s" match="h6" use="generate-id(preceding-sibling::h5[1])"/>
+
+ <xsl:template match="/">
+ <xsl:choose>
+ <xsl:when test="name(child::node())='html'">
+ <xsl:apply-templates/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <document>
+ <header><title>Error in conversion</title></header>
+ <body>
+ <warning>This file is not in a html format, please convert manually.</warning>
+ </body>
+ </document>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="html">
+ <document>
+ <xsl:apply-templates/>
+ </document>
+ </xsl:template>
+
+ <xsl:template match="head">
+ <header>
+ <xsl:apply-templates/>
+ </header>
+ </xsl:template>
+
+ <xsl:template match="meta">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!--infer structure from sibling headings-->
+ <xsl:template match="body">
+ <body>
+ <xsl:apply-templates select="*[1]" mode="next"/>
+ <xsl:call-template name="process_h1"/>
+ </body>
+ </xsl:template>
+
+ <xsl:template name="process_h1">
+ <xsl:for-each select="h1">
+ <section>
+ <xsl:if test="a/@name">
+ <xsl:attribute name="id"><xsl:value-of select="a/@name"/></xsl:attribute>
+ </xsl:if>
+ <title><xsl:apply-templates/></title>
+ <xsl:apply-templates select="following-sibling::*[1]" mode="next"/>
+ <xsl:for-each select="key('h2s',generate-id(.))">
+ <section>
+ <title><xsl:apply-templates/></title>
+ <xsl:apply-templates select="following-sibling::*[1]" mode="next"/>
+ <xsl:for-each select="key('h3s',generate-id(.))">
+ <section>
+ <title><xsl:apply-templates/></title>
+ <xsl:apply-templates select="following-sibling::*[1]"
+ mode="next"/>
+ <xsl:for-each select="key('h4s',generate-id(.))">
+ <section>
+ <title><xsl:apply-templates/></title>
+ <xsl:apply-templates select="following-sibling::*[1]"
+ mode="next"/>
+ <xsl:for-each select="key('h5s',generate-id(.))">
+ <section>
+ <title><xsl:apply-templates/></title>
+ <xsl:apply-templates select="following-sibling::*[1]"
+ mode="next"/>
+ <xsl:for-each select="key('h6s',generate-id(.))">
+ <section>
+ <title><xsl:apply-templates/></title>
+ <xsl:apply-templates select="following-sibling::*[1]" mode="next"/>
+ </section>
+ </xsl:for-each>
+ </section>
+ </xsl:for-each>
+ </section>
+ </xsl:for-each>
+ </section>
+ </xsl:for-each>
+ </section>
+ </xsl:for-each>
+ </section>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!--process each sibling in order until the next heading level-->
+
+ <xsl:template match="*" mode="next">
+ <xsl:if test="not( translate( local-name(.),'123456','' ) = 'h' )">
+ <xsl:apply-templates select="."/>
+ <xsl:apply-templates select="following-sibling::*[1]" mode="next"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="P|p">
+ <p>
+ <xsl:if test="@class">
+ <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <xsl:template match="img">
+ <xsl:choose>
+ <xsl:when test="name(..)='section'">
+ <figure alt="{@alt}" src= "{@src}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <img alt="{@alt}" src= "{@src}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="source|blockquote">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <code>
+ <xsl:value-of select="." />
+ </code>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <source>
+ <xsl:value-of select="." />
+ </source>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- convert a to link -->
+ <xsl:template match="a">
+ <xsl:if test="@name">
+ <!-- Attach an id to the current node -->
+ <xsl:attribute name="id"><xsl:value-of select="translate(@name, ' $', '__')"/></xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:if>
+ <xsl:if test="@href">
+ <link href="{@href}">
+ <xsl:apply-templates/>
+ </link>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="@valign | @align"/>
+
+ <xsl:template match="center">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:apply-templates/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="ol">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:text disable-output-escaping="yes"><![CDATA[</p>]]></xsl:text>
+ <ol>
+ <xsl:apply-templates/>
+ </ol>
+ <xsl:text disable-output-escaping="yes"><![CDATA[<p>]]></xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <ol>
+ <xsl:apply-templates/>
+ </ol>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="ul">
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:text disable-output-escaping="yes"><![CDATA[</p>]]></xsl:text>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ <xsl:text disable-output-escaping="yes"><![CDATA[<p>]]></xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="b">
+ <strong>
+ <xsl:value-of select = "."/>
+ </strong>
+ </xsl:template>
+
+ <xsl:template match="i">
+ <em>
+ <xsl:value-of select = "."/>
+ </em>
+ </xsl:template>
+
+ <xsl:template match="u">
+ <u>
+ <xsl:value-of select = "."/>
+ </u>
+ </xsl:template>
+
+ <xsl:template match="table">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+
+ <xsl:template match="br">
+ <xsl:choose>
+ <xsl:when test="normalize-space(text())">
+
+ <xsl:choose>
+ <xsl:when test="name(..)='p'">
+ <xsl:apply-templates/>
+ <br/>
+ </xsl:when>
+ <xsl:otherwise>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:otherwise>
+ <br/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Strip -->
+ <xsl:template match="font|big">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+
+ <xsl:template match="span">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'bold')">
+ <strong>
+ <xsl:apply-templates/>
+ </strong>
+ </xsl:when>
+ <xsl:when test="contains(@style,'italic')">
+ <em>
+ <xsl:apply-templates/>
+ </em>
+ </xsl:when>
+ <xsl:when test="contains(@style,'underline')">
+ <u>
+ <xsl:apply-templates/>
+ </u>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Strip -->
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:apply-templates select="./*"/>
+ </xsl:template>
+
+ <xsl:template match="@*|*|text()|processing-instruction()|comment()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|*|text()|processing-instruction()|comment()"/>
+ </xsl:copy>
+ </xsl:template>
+
+
+</xsl:stylesheet>
Propchange: forrest/trunk/main/webapp/resources/stylesheets/html-to-document.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/html-to-htmlbody.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/html-to-htmlbody.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/html-to-htmlbody.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/html-to-htmlbody.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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.
+-->
+<!--
+Stylesheet which strips everything outside the <body> and replaces it with <div
+class="content">, making raw HTML suitable for merging with the Forrest tabs
+and menu.
+-->
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:import href="copyover.xsl"/>
+ <xsl:template match="/*[local-name()='html']">
+ <xsl:apply-templates select="*[local-name()='body']"/>
+ </xsl:template>
+
+ <xsl:template match="/*[local-name()='html']/*[local-name()='body']">
+ <div class="content">
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+</xsl:stylesheet>
+
Propchange: forrest/trunk/main/webapp/resources/stylesheets/html-to-htmlbody.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/webapp/resources/stylesheets/linkmap-to-document.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/linkmap-to-document.xsl?rev=307241&view=auto
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/linkmap-to-document.xsl (added)
+++ forrest/trunk/main/webapp/resources/stylesheets/linkmap-to-document.xsl Fri Oct 7 19:51:03 2005
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2002-2005 The Apache Software Foundation or its licensors,
+ as applicable.
+
+ Licensed 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml"
+ version="1.0"
+ omit-xml-declaration="no"
+ indent="yes"
+ doctype-public="-//APACHE//DTD Documentation V1.2//EN"
+ doctype-system="http://forrest.apache.org/dtd/document-v12.dtd" />
+
+ <xsl:template match="/">
+ <document>
+ <header>
+ <title>Site Linkmap</title>
+ </header>
+ <body>
+ <section>
+ <title>Table of Contents</title>
+ <xsl:apply-templates select="*[not(self::site)]" />
+ </section>
+ </body>
+ </document>
+ </xsl:template>
+
+ <xsl:template match="*">
+ <xsl:if test="@label">
+ <ul>
+ <li><a href="{@href}"><xsl:value-of select="@label" /></a>   _________________________  <em><xsl:value-of select="name(.)" /></em></li>
+
+ <xsl:if test="*">
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:if>
+ </ul>
+ </xsl:if>
+
+ </xsl:template>
+
+</xsl:stylesheet>
+
Propchange: forrest/trunk/main/webapp/resources/stylesheets/linkmap-to-document.xsl
------------------------------------------------------------------------------
svn:eol-style = native