~ubuntu-branches/ubuntu/trusty/chemical-mime-data/trusty

« back to all changes in this revision

Viewing changes to xsl/cmd_common.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Leidert (dale), Daniel Leidert, LI Daobing
  • Date: 2008-01-07 22:08:45 UTC
  • mfrom: (2.1.1 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080107220845-35u19hg94jwjf0l1
Tags: 0.1.94-3
[ Daniel Leidert ]
* debian/chemical-mime-data.postinst: Removed. Better call dh_installmime.
* debian/chemical-mime-data.postrm: Ditto.
* debian/compat: Raise compatibility level to 5.
* debian/control: Homepage and Vcs fields transition. Added
  XS-DM-Upload-Allowed for DM status.
  (Maintainer): Set the debichem team as maintainer.
  (Standards-Version): Updated to 3.7.3 (no other changes).
  (Build-Depends): Raise debhelper version.
* debian/rules (binary-indep): Call dh_installmime to create postinst/postrm
  snippets.
* debian/watch: Slightly updated.

[ LI Daobing ]
* debian/rules: lintian doesn't like "-$(MAKE) clean", see bug#325372

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
 
3
3
<!--
4
 
  Document  $Id: cmd_common.xsl,v 1.2 2006/05/02 13:19:55 dleidert Exp $
 
4
  Document  $Id: cmd_common.xsl,v 1.6 2007/01/27 11:41:57 dleidert Exp $
5
5
  Summary   XSLT stylesheet that contains commonly used templates.
6
6
  
7
 
  Copyright (C) 2006 Daniel Leidert <daniel.leidert@wgdd.de>.
 
7
  Copyright (C) 2006,2007 Daniel Leidert <daniel.leidert@wgdd.de>.
8
8
 
9
9
  This file is free software. The copyright owner gives unlimited
10
10
  permission to copy, distribute and modify it.
13
13
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
14
14
                xmlns:saxon="http://icl.com/saxon"
15
15
                xmlns:lxslt="http://xml.apache.org/xslt"
16
 
                xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"
 
16
                xmlns:redirect="http://xml.apache.org/xalan/redirect"
17
17
                xmlns:exsl="http://exslt.org/common"
18
18
                version="1.0"
19
 
                extension-element-prefixes="saxon xalanredirect lxslt exsl">
20
 
 
21
 
<!-- 
22
 
        This template writes out the specified file.
23
 
-->
24
 
<xsl:template name="write.chunk">
 
19
                extension-element-prefixes="saxon redirect lxslt exsl">
 
20
 
 
21
 
 
22
<!-- ********************************************************************* -->
 
23
<!-- * Named templates for common functions.                               -->
 
24
<!-- ********************************************************************* -->
 
25
 
 
26
<xsl:template name="common.header.text">
 
27
  <!-- * A created text file shall contain a header with information about -->
 
28
  <!-- * the license and the database version.                             -->
 
29
        <xsl:text>#  This file is part of the chemical-mime-data package.
 
30
#  It is distributed under the GNU Lesser General Public License version 2.1.
 
31
#
 
32
#  Database: </xsl:text><xsl:value-of select="chemical-mime/@id"/><xsl:text>&#10;&#10;&#10;</xsl:text>
 
33
</xsl:template>
 
34
 
 
35
<xsl:template name="common.header.xml">
 
36
  <!-- * A created xml file shall contain a header with information about  -->
 
37
  <!-- * the license and the database version.                             -->
 
38
        <xsl:comment>
 
39
                <xsl:text>
 
40
  This file is part of the chemical-mime-data package.
 
41
  It is distributed under the GNU Lesser General Public License version 2.1.
 
42
 
 
43
  Database: </xsl:text>
 
44
                <xsl:value-of select="chemical-mime/@id"/>
 
45
                <xsl:text>&#10;</xsl:text>
 
46
        </xsl:comment>
 
47
        <xsl:text>&#10;&#10;</xsl:text>
 
48
</xsl:template>
 
49
 
 
50
<xsl:template name="common.write.chunk">
 
51
  <!-- * This template output the given content into a file with the given -->
 
52
  <!-- * filename, encoding and media type. With this template we can      -->
 
53
  <!-- * write several output files from one input file. Therefor we need  -->
 
54
  <!-- * several extensions. The default is EXSLT, which is implemented in -->
 
55
  <!-- * linxslt1.1 (xsltproc). The other are nice to have, but unused     -->
 
56
  <!-- * atm.                                                              -->
25
57
        <xsl:param name="filename" select="''"/>
26
 
  <xsl:param name="method" select="''"/>
 
58
        <xsl:param name="method" select="''"/>
27
59
        <xsl:param name="indent" select="''"/>
28
60
        <xsl:param name="omit-xml-declaration" select="''"/>
29
61
        <xsl:param name="media-type" select="''"/>
30
62
        <xsl:param name="doctype-public" select="''"/>
31
63
        <xsl:param name="doctype-system" select="''"/>
32
 
  <xsl:param name="content"/>
 
64
        <xsl:param name="content"/>
33
65
 
34
 
        <!--
35
 
                Output the specified file.
36
 
        -->
37
66
        <xsl:choose>
38
 
                <!-- exslt:document -->
 
67
    <!-- * Check if EXSLT's exslt:document() is available.                 -->
39
68
                <xsl:when test="element-available('exsl:document')">
40
69
                        <xsl:choose>
41
70
                                <xsl:when test="$doctype-public != '' and $doctype-system != ''">
62
91
                                </xsl:otherwise>
63
92
                        </xsl:choose>
64
93
                </xsl:when>
65
 
                <!-- saxon:output -->
 
94
    <!-- * Check if Saxon's saxon:output() is available.                   -->
66
95
                <xsl:when test="element-available('saxon:output')">
67
96
                        <xsl:choose>
68
97
                                <xsl:when test="$doctype-public != '' and $doctype-system != ''">
91
120
                                </xsl:otherwise>
92
121
                        </xsl:choose>
93
122
                </xsl:when>
94
 
                <!-- xalanredirect -->
95
 
                <xsl:when test="element-available('xalanredirect:write')">
96
 
                        <xalanredirect:write file="{$filename}">
 
123
    <!-- * Check if Xalan's redirect:write() is available.                 -->
 
124
                <xsl:when test="element-available('redirect:write')">
 
125
                        <redirect:write file="{$filename}">
97
126
                                <xsl:copy-of select="$content"/>
98
 
                        </xalanredirect:write>
 
127
                        </redirect:write>
99
128
                </xsl:when>
100
129
                <xsl:otherwise>
101
 
      <!-- it doesn't matter since we won't be making chunks... -->
102
 
      <xsl:message terminate="yes">
103
 
        <xsl:text>Can't make chunks with </xsl:text>
104
 
        <xsl:value-of select="system-property('xsl:vendor')"/>
105
 
        <xsl:text>'s processor.</xsl:text>
106
 
      </xsl:message>
107
 
    </xsl:otherwise>
 
130
      <!-- * And if nothing of these are available, output an error.       -->
 
131
                        <xsl:message terminate="yes">
 
132
                                <xsl:text>Can't make chunks with </xsl:text>
 
133
                                <xsl:value-of select="system-property('xsl:vendor')"/>
 
134
                                <xsl:text>'s processor.</xsl:text>
 
135
                        </xsl:message>
 
136
                </xsl:otherwise>
108
137
        </xsl:choose>
109
138
        
110
 
        <!--
111
 
                Now be a bit verbose and tell, which file we wrote.
112
 
        -->
 
139
  <!-- * Be verbose, which file is output.                                 -->
113
140
        <xsl:message>
114
141
                <xsl:text>Writing </xsl:text>
115
142
                <xsl:value-of select="$filename"/>
117
144
        </xsl:message>
118
145
</xsl:template>
119
146
 
120
 
<!--
121
 
        The created text-files all contain the same header.
122
 
-->
123
 
<xsl:template name="header.desktop">
124
 
        <xsl:text>[Desktop Entry]
125
 
Encoding=UTF-8
126
 
Type=MimeType&#10;</xsl:text>
127
 
</xsl:template>
128
 
 
129
 
<!--
130
 
        Even the created text-files shall contain a short summary with license
131
 
        and database version information.
132
 
-->
133
 
<xsl:template name="header.text">
134
 
        <xsl:text>#  This file is part of the chemical-mime-data package.
135
 
#  It is distributed under the GNU Lesser General Public License version 2.1.
136
 
#
137
 
#  Database: </xsl:text><xsl:value-of select="chemical-mime/@id"/><xsl:text>&#10;&#10;&#10;</xsl:text>
138
 
</xsl:template>
139
 
 
140
 
<!--
141
 
        Even the created xml-files shall contain a short summary with license
142
 
        and database version information.
143
 
-->
144
 
<xsl:template name="header.xml">
145
 
        <xsl:comment>
146
 
                <xsl:text>
147
 
  This file is part of the chemical-mime-data package.
148
 
  It is distributed under the GNU Lesser General Public License version 2.1.
149
 
 
150
 
  Database: </xsl:text>
151
 
        <xsl:value-of select="chemical-mime/@id"/>
152
 
        <xsl:text>&#10;</xsl:text>
153
 
  </xsl:comment>
154
 
        <xsl:text>&#10;&#10;</xsl:text>
155
 
</xsl:template>
156
 
 
157
 
 
158
 
 
159
 
</xsl:stylesheet>
 
 
b'\\ No newline at end of file'
 
147
</xsl:stylesheet>
 
148