| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <?xml version='1.0'?>
- <!--
- Copyright © 2004-2006 by Idiom Technologies, Inc. All rights reserved.
- IDIOM is a registered trademark of Idiom Technologies, Inc. and WORLDSERVER
- and WORLDSTART are trademarks of Idiom Technologies, Inc. All other
- trademarks are the property of their respective owners.
- IDIOM TECHNOLOGIES, INC. IS DELIVERING THE SOFTWARE "AS IS," WITH
- ABSOLUTELY NO WARRANTIES WHATSOEVER, WHETHER EXPRESS OR IMPLIED, AND IDIOM
- TECHNOLOGIES, INC. DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE AND WARRANTY OF NON-INFRINGEMENT. IDIOM TECHNOLOGIES, INC. SHALL NOT
- BE LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, COVER, PUNITIVE, EXEMPLARY,
- RELIANCE, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO LOSS OF
- ANTICIPATED PROFIT), ARISING FROM ANY CAUSE UNDER OR RELATED TO OR ARISING
- OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF IDIOM
- TECHNOLOGIES, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- Idiom Technologies, Inc. and its licensors shall not be liable for any
- damages suffered by any person as a result of using and/or modifying the
- Software or its derivatives. In no event shall Idiom Technologies, Inc.'s
- liability for any damages hereunder exceed the amounts received by Idiom
- Technologies, Inc. as a result of this transaction.
- These terms and conditions supersede the terms and conditions in any
- licensing agreement to the extent that such terms and conditions conflict
- with those set forth herein.
- This file is part of the DITA Open Toolkit project hosted on Sourceforge.net.
- See the accompanying license.txt file for applicable licenses.
- -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:opentopic="http://www.idiominc.com/opentopic"
- exclude-result-prefixes="opentopic"
- version="2.0">
- <xsl:template match="*[contains(@class, ' map/topicmeta ')]">
- <fo:block-container xsl:use-attribute-sets="__frontmatter__owner__container">
- <xsl:apply-templates/>
- </fo:block-container>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' topic/author ')]">
- <fo:block xsl:use-attribute-sets="author" >
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' topic/publisher ')]">
- <fo:block xsl:use-attribute-sets="publisher" >
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' topic/copyright ')]">
- <fo:block xsl:use-attribute-sets="copyright" >
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' topic/copyryear ')]">
- <fo:inline xsl:use-attribute-sets="copyryear" >
- <xsl:value-of select="@year"/><xsl:text> </xsl:text>
- </fo:inline>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' topic/copyrholder ')]">
- <fo:inline xsl:use-attribute-sets="copyrholder" >
- <xsl:apply-templates/>
- </fo:inline>
- </xsl:template>
- <xsl:variable name="map" select="//opentopic:map"/>
- <xsl:template name="createFrontMatter">
- <xsl:if test="$generate-front-cover">
- <fo:page-sequence master-reference="front-matter" xsl:use-attribute-sets="page-sequence.cover">
- <xsl:call-template name="insertFrontMatterStaticContents"/>
- <fo:flow flow-name="xsl-region-body">
- <fo:block-container xsl:use-attribute-sets="__frontmatter">
- <xsl:call-template name="createFrontCoverContents"/>
- </fo:block-container>
- </fo:flow>
- </fo:page-sequence>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="createFrontCoverContents">
- <!-- set the title -->
- <fo:block xsl:use-attribute-sets="__frontmatter__title">
- <xsl:choose>
- <xsl:when test="$map/*[contains(@class,' topic/title ')][1]">
- <xsl:apply-templates select="$map/*[contains(@class,' topic/title ')][1]"/>
- </xsl:when>
- <xsl:when test="$map//*[contains(@class,' bookmap/mainbooktitle ')][1]">
- <xsl:apply-templates select="$map//*[contains(@class,' bookmap/mainbooktitle ')][1]"/>
- </xsl:when>
- <xsl:when test="//*[contains(@class, ' map/map ')]/@title">
- <xsl:value-of select="//*[contains(@class, ' map/map ')]/@title"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/descendant::*[contains(@class, ' topic/topic ')][1]/*[contains(@class, ' topic/title ')]"/>
- </xsl:otherwise>
- </xsl:choose>
- </fo:block>
- <!-- set the subtitle -->
- <xsl:apply-templates select="$map//*[contains(@class,' bookmap/booktitlealt ')]"/>
- <fo:block xsl:use-attribute-sets="__frontmatter__owner">
- <xsl:apply-templates select="$map//*[contains(@class,' bookmap/bookmeta ')]"/>
- </fo:block>
- </xsl:template>
-
- <xsl:template name="createBackCover">
- <xsl:if test="$generate-back-cover">
- <fo:page-sequence master-reference="back-cover" xsl:use-attribute-sets="back-cover">
- <xsl:call-template name="insertBackCoverStaticContents"/>
- <fo:flow flow-name="xsl-region-body">
- <fo:block-container xsl:use-attribute-sets="__back-cover">
- <xsl:call-template name="createBackCoverContents"/>
- </fo:block-container>
- </fo:flow>
- </fo:page-sequence>
- </xsl:if>
- </xsl:template>
- <xsl:template name="createBackCoverContents">
- <fo:block></fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' bookmap/bookmeta ')]" priority="1">
- <fo:block-container xsl:use-attribute-sets="__frontmatter__owner__container">
- <fo:block >
- <xsl:apply-templates/>
- </fo:block>
- </fo:block-container>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' bookmap/booktitlealt ')]" priority="2">
- <fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' bookmap/booktitle ')]" priority="2">
- <fo:block xsl:use-attribute-sets="__frontmatter__booklibrary">
- <xsl:apply-templates select="*[contains(@class, ' bookmap/booklibrary ')]"/>
- </fo:block>
- <fo:block xsl:use-attribute-sets="__frontmatter__mainbooktitle">
- <xsl:apply-templates select="*[contains(@class,' bookmap/mainbooktitle ')]"/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' xnal-d/namedetails ')]">
- <fo:block>
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' xnal-d/addressdetails ')]">
- <fo:block>
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' xnal-d/contactnumbers ')]">
- <fo:block>
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' bookmap/bookowner ')]">
- <fo:block xsl:use-attribute-sets="author">
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
- <xsl:template match="*[contains(@class, ' bookmap/summary ')]">
- <fo:block xsl:use-attribute-sets="bookmap.summary">
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
-
- </xsl:stylesheet>
|