summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex4ht/xtpipes/docbook.4xt
blob: 903aaf4838b0b8205c2397960b85505fc4cf0091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE xtpipes SYSTEM "xtpipes.dtd" >
<xtpipes preamble="yes" signature="docbook.4xt (2008-02-22-01:05)">
   <sax content-handler="xtpipes.util.ScriptsManager"
        lexical-handler="xtpipes.util.ScriptsManagerLH" >
     <script element="ulink" >
   <set name="ulink" >
      <![CDATA[
   <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   >
      <xsl:output omit-xml-declaration = "yes" />

      <xsl:template match=" ulink[
   @url and starts-with( @url, '#')
]" >
   <link>
      <xsl:attribute name="linkend">
         <xsl:value-of select=" substring( @url, 2 )" />
      </xsl:attribute>
      <xsl:apply-templates select="*|text()|comment()" />
   </link>
</xsl:template>

            <xsl:template match="*|@*|text()|comment()" >
        <xsl:copy>
          <xsl:apply-templates select="*|@*|text()|comment()" />
        </xsl:copy>
      </xsl:template>
   </xsl:stylesheet>
]]>

   </set>
   <xslt name="." xml="." xsl="ulink" />
</script>

     <script element="tbody" >
   <set name="tbody" >
      <![CDATA[
   <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   >
      <xsl:output omit-xml-declaration = "yes" />

      <xsl:template match=" row[ @role = 'hline' ]" />
<xsl:template match=" row[ @role = 'hline' ]" />
<xsl:template match=" row[
       following-sibling::*[1][ self::row[@role = 'hline'] ]
] ">
   <xsl:copy>
      <xsl:attribute name="rowsep">
         <xsl:text>1</xsl:text>
      </xsl:attribute>
      <xsl:apply-templates select="*|@*|text()|comment()" />
   </xsl:copy>
</xsl:template>
<xsl:template match=" row[
     (@role = 'cline')
     and
     preceding-sibling::*[1]
                         [ self::row[ not(@role) ] ]
     and
     ( count(child::entry) = count(preceding-sibling::*[1]/child::entry))
]" />
<xsl:template match=" row[
       not(@role)
   and
       following-sibling::*[1][ self::row[@role = 'cline'] ]
   and
     ( count(child::entry) = count(following-sibling::*[1]/child::entry))
] ">
   <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates select="*|text()|comment()" mode="cline" />
   </xsl:copy>
</xsl:template>
<xsl:template match=" text()|comment() " mode="cline">
   <xsl:copy>
      <xsl:apply-templates select="*|@*|text()|comment()"  />
   </xsl:copy>
</xsl:template>
<xsl:template match="*" mode="cline">
   <xsl:copy>
      <xsl:if test="self::entry">
         <xsl:attribute name="rowsep">
             <xsl:variable name="pos">
                <xsl:value-of select="position()" />
             </xsl:variable>
             <xsl:value-of select="parent::row
                                   / following-sibling::*[1]
                                   / child::entry[position()=$pos]
                                   / @rowsep
                                    " />
          </xsl:attribute>
      </xsl:if>
      <xsl:apply-templates select="*|@*|text()|comment()"  />
   </xsl:copy>
</xsl:template>

            <xsl:template match="*|@*|text()|comment()" >
        <xsl:copy>
          <xsl:apply-templates select="*|@*|text()|comment()" />
        </xsl:copy>
      </xsl:template>
   </xsl:stylesheet>
]]>

   </set>
   <xslt name="." xml="." xsl="tbody" />
</script>

   </sax>
</xtpipes>