1 | <?xml version="1.0"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!-- (c) Copyright IBM Corporation 2010. All Rights Reserved. -->
|
---|
6 | <xsl:stylesheet version="1.0"
|
---|
7 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
8 | xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
|
---|
9 | exclude-result-prefixes="dita-ot"
|
---|
10 | >
|
---|
11 |
|
---|
12 | <!-- DEFAULT RULE: FOR EVERY ELEMENT, ONLY PROCESS TEXT CONTENT -->
|
---|
13 | <xsl:template match="*" mode="dita-ot:text-only">
|
---|
14 | <xsl:apply-templates select="text()|*|processing-instruction()" mode="dita-ot:text-only"/>
|
---|
15 | </xsl:template>
|
---|
16 |
|
---|
17 | <xsl:template match="text()" mode="dita-ot:text-only">
|
---|
18 | <xsl:value-of select="."/>
|
---|
19 | </xsl:template>
|
---|
20 |
|
---|
21 | <!-- add "'" for q -->
|
---|
22 | <xsl:template match="*[contains(@class,' topic/q ')]" mode="dita-ot:text-only">
|
---|
23 | <xsl:call-template name="getString">
|
---|
24 | <xsl:with-param name="stringName" select="'OpenQuote'"/>
|
---|
25 | </xsl:call-template>
|
---|
26 | <xsl:apply-templates mode="dita-ot:text-only"/>
|
---|
27 | <xsl:call-template name="getString">
|
---|
28 | <xsl:with-param name="stringName" select="'CloseQuote'"/>
|
---|
29 | </xsl:call-template>
|
---|
30 | </xsl:template>
|
---|
31 |
|
---|
32 |
|
---|
33 | <xsl:template match="processing-instruction()" mode="dita-ot:text-only"/>
|
---|
34 |
|
---|
35 | <!-- ELEMENTS THAT SHOULD BE DROPPED FROM DEFAULT TEXT-ONLY RENDITIONS -->
|
---|
36 | <xsl:template match="*[contains(@class,' topic/indexterm ')]" mode="dita-ot:text-only"/>
|
---|
37 | <xsl:template match="*[contains(@class,' topic/draft-comment ')]" mode="dita-ot:text-only"/>
|
---|
38 | <xsl:template match="*[contains(@class,' topic/required-cleanup ')]" mode="dita-ot:text-only"/>
|
---|
39 | <xsl:template match="*[contains(@class,' topic/data ')]" mode="dita-ot:text-only"/>
|
---|
40 | <xsl:template match="*[contains(@class,' topic/data-about ')]" mode="dita-ot:text-only"/>
|
---|
41 | <xsl:template match="*[contains(@class,' topic/unknown ')]" mode="dita-ot:text-only"/>
|
---|
42 | <xsl:template match="*[contains(@class,' topic/foreign ')]" mode="dita-ot:text-only"/>
|
---|
43 |
|
---|
44 | <!-- EXCEPTIONS -->
|
---|
45 | <xsl:template match="*[contains(@class,' topic/image ')]" mode="dita-ot:text-only">
|
---|
46 | <xsl:choose>
|
---|
47 | <xsl:when test="*[contains(@class,' topic/alt ')]"><xsl:apply-templates mode="dita-ot:text-only"/></xsl:when>
|
---|
48 | <xsl:when test="@alt"><xsl:value-of select="@alt"/></xsl:when>
|
---|
49 | </xsl:choose>
|
---|
50 | </xsl:template>
|
---|
51 |
|
---|
52 | <!-- Footnote as text-only: should just create the number in parens -->
|
---|
53 | <xsl:template match="*[contains(@class,' topic/fn ')]" mode="dita-ot:text-only">
|
---|
54 | <xsl:variable name="fnid"><xsl:number from="/" level="any"/></xsl:variable>
|
---|
55 | <xsl:choose>
|
---|
56 | <xsl:when test="@callout">(<xsl:value-of select="@callout"/>)</xsl:when>
|
---|
57 | <xsl:otherwise>(<xsl:value-of select="$fnid"/>)</xsl:otherwise>
|
---|
58 | </xsl:choose>
|
---|
59 | </xsl:template>
|
---|
60 |
|
---|
61 | <xsl:template match="*[contains(@class,' topic/xref ')]" mode="dita-ot:text-only">
|
---|
62 | <xsl:apply-templates select="node()[not(contains(@class,' topic/desc '))]" mode="dita-ot:text-only"/>
|
---|
63 | </xsl:template>
|
---|
64 |
|
---|
65 |
|
---|
66 | <xsl:template match="*[contains(@class,' topic/boolean ')]" mode="dita-ot:text-only">
|
---|
67 | <xsl:value-of select="name()"/><xsl:text>: </xsl:text><xsl:value-of select="@state"/>
|
---|
68 | </xsl:template>
|
---|
69 | <xsl:template match="*[contains(@class,' topic/state ')]" mode="dita-ot:text-only">
|
---|
70 | <xsl:value-of select="name()"/><xsl:text>: </xsl:text><xsl:value-of select="@name"/><xsl:text>=</xsl:text><xsl:value-of select="@value"/>
|
---|
71 | </xsl:template>
|
---|
72 |
|
---|
73 | </xsl:stylesheet>
|
---|