Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
b26e7d12
Commit
b26e7d12
authored
Dec 19, 2016
by
cliclac
Browse files
Résolution de quelques problèmes de validation et d'affichage.
parent
e4e99fd4
Changes
7
Hide whitespace changes
Inline
Side-by-side
hdoc_to_epub/file/mimetype
View file @
b26e7d12
application/epub+zip
application/epub+zip
\ No newline at end of file
hdoc_to_epub/xsl/chapitre.xsl
View file @
b26e7d12
...
...
@@ -5,9 +5,9 @@
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns=
"http://www.w3.org/1999/xhtml"
version=
"2.0"
>
<xsl:output
method=
"xml"
indent=
"yes"
encoding=
"UTF-8"
/>
<xsl:template
match=
"/html"
priority=
"10"
>
<xsl:for-each
select=
"body/section"
>
<xsl:variable
name=
"path"
>
../../../retour/oebps/chapitres/chapitre
<xsl:number
level=
"multiple"
count=
"section"
format=
"1"
/>
.xhtml
</xsl:variable>
...
...
@@ -24,27 +24,27 @@
</xsl:result-document>
</xsl:for-each>
</xsl:template>
<xsl:template
match=
"section"
priority=
"3"
>
<xsl:element
name=
"h{count(ancestor::section)+1}"
>
<xsl:value-of
select=
"header/h1"
/>
<xsl:apply-templates
select=
"div|section"
/>
</xsl:element>
<xsl:apply-templates
select=
"div|section"
/>
</xsl:template>
<!-- Identity transformation -->
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
<xsl:template
match=
"*"
priority=
"1"
>
<xsl:element
name=
"{local-name()}"
>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:template>
</xsl:stylesheet>
hdoc_to_epub/xsl/content.xsl
View file @
b26e7d12
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:dc=
"http://www.idpf.org/2007/opf"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes=
"xs"
xmlns=
"http://www.idpf.org/2007/opf"
version=
"2.0"
>
<xsl:import
href=
"content/metadata.xsl"
/>
...
...
@@ -13,7 +13,7 @@
<xsl:output
method=
"xml"
indent=
"yes"
encoding=
"UTF-8"
/>
<xsl:template
match=
"html"
>
<package
unique-identifier=
"BookID"
version=
"
3
.0"
>
<package
unique-identifier=
"BookID"
version=
"
2
.0"
>
<xsl:call-template
name=
"metadata"
/>
<xsl:call-template
name=
"manifest"
/>
<xsl:call-template
name=
"spine"
/>
...
...
hdoc_to_epub/xsl/content/manifest.xsl
View file @
b26e7d12
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:dc=
"http://www.idpf.org/2007/opf"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes=
"xs"
xmlns=
"http://www.idpf.org/2007/opf"
version=
"2.0"
>
<xsl:template
name=
"manifest"
>
<manifest>
<item
id=
"tDMncx"
href=
"tableDesMatieres.ncx"
media-type=
"application/x-dtbncx+xml"
/>
<item
id=
"tDMncx"
href=
"tableDesMatieres.ncx"
media-type=
"application/x-dtbncx+xml"
/>
<xsl:for-each
select=
"body/section"
>
<item>
<xsl:attribute
name=
"href"
>
chapitres/chapitre
<xsl:number
level=
"multiple"
count=
"section"
format=
"1"
/>
.xhtml
</xsl:attribute>
<xsl:attribute
name=
"id"
>
ch
<xsl:number
level=
"multiple"
count=
"section"
format=
"1"
/></xsl:attribute>
<xsl:attribute
name=
"id"
>
ch
_
<xsl:number
level=
"multiple"
count=
"section"
format=
"1"
/></xsl:attribute>
<xsl:attribute
name=
"media-type"
>
application/xhtml+xml
</xsl:attribute>
</item>
</xsl:for-each>
</manifest>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
hdoc_to_epub/xsl/content/metadata.xsl
View file @
b26e7d12
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:dc=
"http://www.idpf.org/2007/opf"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes=
"xs"
xmlns=
"http://www.idpf.org/2007/opf"
version=
"2.0"
>
<xsl:template
name=
"metadata"
>
<metadata>
<metadata
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
>
<dc:title><xsl:value-of
select=
"head/title"
/></dc:title>
<dc:creator><xsl:value-of
select=
"head/meta[@name='author']/@content"
/></dc:creator>
<dc:language>
fr
</dc:language>
<dc:identifier
id=
"BookID"
>
V2.0
</dc:identifier>
</metadata>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
hdoc_to_epub/xsl/content/spine.xsl
View file @
b26e7d12
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:dc=
"http://www.idpf.org/2007/opf"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes=
"xs"
xmlns=
"http://www.idpf.org/2007/opf"
version=
"2.0"
>
<xsl:template
name=
"spine"
>
<spine
toc=
"tDMncx"
>
<xsl:for-each
select=
"body/section"
>
<itemref>
<xsl:attribute
name=
"idref"
>
ch
<xsl:number
level=
"multiple"
count=
"section"
format=
"1"
/></xsl:attribute>
<xsl:attribute
name=
"idref"
>
ch
_
<xsl:number
level=
"multiple"
count=
"section"
format=
"1"
/></xsl:attribute>
</itemref>
</xsl:for-each>
</spine>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
hdoc_to_epub/xsl/tdmncx.xsl
View file @
b26e7d12
...
...
@@ -13,7 +13,9 @@
<head>
<meta
content=
"org-example-5059463624137734586"
name=
"dtb:uid"
/>
</head>
<docTitle>
<text><xsl:value-of
select=
"head/title"
/></text>
</docTitle>
<navMap>
<xsl:apply-templates/>
</navMap>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment