Debian Codegraph @

texmf-dist/doc/bibtex/bibhtml/bibhtml-insert-bib.xslt

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 ! bibhtml-extract-aux.xslt
4 !
5 ! Part of bibhtml, version 2.0.2, released 2013 September 8
6 ! Hg node 7076ce83a035.
7 ! See <http://purl.org/nxg/dist/bibhtml>
8 !
9 ! This sample script processes an XML file which contains elements like
10 ! <span class='cite'>citation</span>, extracting each of the `citation'
11 ! strings and emitting a .aux file which, once a \bibdata line has been
12 ! appended, is suitable for processing with BibTeX. Adapt or extend as
13 ! appropriate.
14 !-->
15 <x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform"
16 version="1.0"
17 xmlns="http://www.w3.org/1999/xhtml"
18 exclude-result-prefixes="h"
19 xmlns:h="http://www.w3.org/1999/xhtml">
20
21 <x:output method="xml"
22 version="1.0"
23 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
24 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
25 omit-xml-declaration="yes"/>
26
27 <x:param name='bibfile-name'>bibliography</x:param>
28
29
30 <!-- identity transform -->
31 <x:template match="*">
32 <x:copy>
33 <x:copy-of select="@*"/>
34 <x:apply-templates/>
35 </x:copy>
36 </x:template>
37
38 <x:template match="h:span[@class='cite']">
39 <a>
40 <x:attribute name='href'>
41 <x:text>#</x:text>
42 <x:copy-of select='.'/>
43 </x:attribute>
44 <x:apply-templates/>
45 </a>
46 </x:template>
47
48 <x:template match='processing-instruction("bibliography")'>
49 <x:copy-of select='document(concat($bibfile-name,".bbl"))'/>
50 </x:template>
51 </x:stylesheet>