![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Am 2014-08-26 um 23:29 schrieb Hans Hagen
On 8/26/2014 7:08 PM, Henning Hraban Ramm wrote:
Creating ePub from ConTeXt is still tedious - you need to tag everything (even paragraphs) with \start/\stop, the resulting export.xml is still missing a root node if you use project structure (components), and you need to tinker a lot with the results, since even available information like title is not written to the relevant ePub files.
rootnode .. in what sense?
Sorry Hans, I complained about that several times already:
If I have a project structure, i.e. a product with components, export.xml starts like
“““
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- input filename : prd_hraban -->
<!-- processing date : Tue Aug 26 12:55:41 2014 -->
<!-- context version : 2014.08.19 11:57 -->
<!-- exporter version : 0.31 -->
<division detail="frontpart">
<metadata>
“““
And since there are several <division>s or other top nodes, Saxon rejects the file because it’s missing a root node.
<metadata> is always put into the first node of the file (that should be the root node).
Only with a single TeX file, I get something like
“““
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!-- input filename : solo -->
<!-- processing date : Wed Mar 12 11:06:58 2014 -->
<!-- context version : 2014.03.07 11:42 -->
<!-- exporter version : 0.30 -->
<document language="en" file="solo" date="Wed Mar 12 11:06:58 2014" context="2014.03.07 11:42" version="0.30" xmlns:m="http://www.w3.org/1998/Math/MathML">
<metadata>
“““
I.e. the root node <document> is missing.
If you were to enhance ePub facilities (how much must I pay you?), it would be nice to see the data that you put in „metavariables“ (title, author) also in the generated OPF, NCX and cover files, and the main language in OPF.
My script also creates a cover image from the first page of the content PDF as well as converts and copies all the included images, but your usual reasoning that everyone has other needs is of course true.
I resolved to generate content, cover, NCX and OPF from export.xml via XSLT, i.e. throw away most of what the epub script does.
But the structure of registers (that I abuse for a sorted ToC) is hard to parse, because there’s no structure that links register text and page number, e.g.:
<register detail="index">
<registersection><!-- probably „A“ -->
<registerentries>
<registerentry>A Elbereth Gilthoniel</registerentry>
<registerpages> <break/>
<registerpage><link destination="internal(105)" location="aut:105">47</link></registerpage></registerpages>
<registerentry>Abitur</registerentry>
<registerpages> <break/>
<registerpage><link destination="internal(87)" location="aut:87">38</link></registerpage></registerpages>
<registerentry>Agradini</registerentry>
<registerpages> <break/>
<registerpage><link destination="internal(32)" location="aut:32">16</link></registerpage></registerpages>
<registerentry>Amselchen</registerentry>
<registerpages> <break/>
<registerpage><link destination="internal(136)" location="aut:136">66</link></registerpage></registerpages>
My XSL for NCX looks like:
<?xml version="1.0" encoding="UTF-8" ?>