epub:create-ocf create-ocf

epubtools/modules/create-ocf/xpl/create-ocf.xpl

Import URI: ../modules/create-ocf/xpl/create-ocf.xpl

This step is used to create the directory structure of the OCF Abstract Container. It is required to provide as option the path to the source html file.

Input Ports

NameDocumentationConnections

meta

an epub-config document, see epub:convert

Output Ports

NameDocumentationConnections

result

files

Options

NameDocumentationDefault

base-uri

debug

'no'

debug-dir-uri

'debug'

Subpipeline

StepInputsOutputsOptions

p:variable variant

meta on create-ocf

(/epub-config/@variant, '')[1]

p:variable layout

meta on create-ocf

(/epub-config/@layout, 'reflowable')[1]

p:group basic-files

p:choose which-files

not(tokenize($variant, '\s+') = ('FIXED-Apple', 'ORIGINAL-CSS'))

p:identity basic-files-1

source

 <cx:document>
   <c:file oebps-name="mimetype"/>
   <c:file oebps-name="META-INF/container.xml"/>
 </cx:document>

result

p:otherwise

p:identity basic-files-2

source

 <cx:document>
   <c:file oebps-name="mimetype"/>
   <c:file oebps-name="META-INF/container.xml"/>
   <c:file oebps-name="META-INF/com.apple.ibooks.display-options.xml"/>
 </cx:document>

result

p:sink d252e82

source

p:group apple-display

p:choose load-options

tokenize($variant, '\s+') = 'ORIGINAL-CSS'

p:identity d252e100

source

result

p:sink d252e102

source

result on d252e100

p:otherwise

p:identity d252e112

source

result

p:sink d252e114

source

result on d252e112

p:sink d252e119

source

p:delete right-options

source

p:document../xml/com.apple.ibooks.display-options.xml

result

match = '*:option[@name ne 'specified-fonts']'

p:sink d252e127

source

result on right-options

p:group create

p:variable workdir

replace($base-uri, '^(.*[/])+(.*)', '$1')

p:identity report

source

p:empty

result

cxf:delete del

recursive = 'true'

fail-on-error = 'false'

href = concat($workdir, 'epub')

cxf:mkdir mkdir1

href = concat($workdir, 'epub')

cxf:mkdir mkdir2

href = concat($workdir, 'epub/META-INF')

cxf:mkdir mkdir3

href = concat($workdir, 'epub/OEBPS')

p:store store1

source

p:document../xml/container.xml

result

method = 'xml'

media-type = 'text/xml'

omit-xml-declaration = 'false'

href = concat($workdir, 'epub/META-INF/container.xml')

p:store store2

source
<c:data method="text" media-type="text/plain" encoding="US-ASCII">application/epub+zip</c:data>

result

method = 'text'

media-type = 'text/plain'

encoding = 'US-ASCII'

href = concat($workdir, 'epub/mimetype')

p:choose fixed

$layout = 'fixed' or tokenize($variant, '\s+') = 'ORIGINAL-CSS'

p:try try-fixed

p:group d252e201

cxf:info d252e210

fail-on-error = 'true'

href = concat($workdir, 'com.apple.ibooks.display-options.xml')

p:load load-applemetadata

result

href = concat($workdir, 'com.apple.ibooks.display-options.xml')

p:store apple-meta

source

result on load-applemetadata

result

method = 'xml'

media-type = 'text/xml'

omit-xml-declaration = 'false'

href = concat($workdir, 'epub/META-INF/com.apple.ibooks.display-options.xml')

p:catch d252e231

error

p:store otherwise

source

result on apple-display

result

method = 'xml'

media-type = 'text/xml'

omit-xml-declaration = 'false'

href = concat($workdir, 'epub/META-INF/com.apple.ibooks.display-options.xml')

p:otherwise

p:sink sink

source

p:empty

p:sink d252e269

source

Used by