Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: develop
Fetching contributors…

Cannot retrieve contributors at this time

file 174 lines (136 sloc) 4.5 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
<?xml version='1.0' encoding='UTF-8'?>
<p:declare-step
xmlns:local = '#empty'
    xmlns:p = 'http://www.w3.org/ns/xproc'
xmlns:c = 'http://www.w3.org/ns/xproc-step'

xmlns:cx = 'http://xmlcalabash.com/ns/extensions'
xmlns:cxf = 'http://xmlcalabash.com/ns/extensions/fileutils'

xmlns:pos = 'http://exproc.org/proposed/steps/os'
xmlns:pxf = 'http://exproc.org/proposed/steps/file'
xmlns:pxfn = 'http://exproc.org/proposed/functions'
xmlns:pxp = 'http://exproc.org/proposed/steps'

xmlns:db = 'http://docbook.org/ns/docbook'
xmlns:xhtml = 'http://www.w3.org/1999/xhtml'
xmlns = 'http://www.w3.org/1999/xhtml'

xpath-version= '2.0'
version = '1.0'

exclude-inline-prefixes="#all"

name = 'build-docbook'
>



<!--
I/O
-->
<p:input port='source'>
<p:document href='src/docbook/docbook.xml' />
</p:input>

<p:output
port = 'result'
primary = 'true'
sequence= 'true'
/>
<p:output
port = 'xhtml5'
primary = 'false'
sequence= 'true'
/>

<p:serialization
port ='result'
doctype-public =''
doctype-system ='"about:legacy-compat"'
encoding ='UTF-8'
indent ='true'
media-type ='application/xhtml+xml'
method ='xhtml'
omit-xml-declaration='false'
version ='1.0'
/>

    <p:serialization
port ='xhtml5'
doctype-public =''
doctype-system ='"about:legacy-compat"'
encoding ='UTF-8'
indent ='true'
media-type ='application/xhtml+xml'
method ='xhtml'
omit-xml-declaration='false'
version ='1.0'
/>


<!--
Imports
-->
<!--<p:import href='http://xmlcalabash.com/extension/steps/library-1.0.xpl' />
<p:import href='http://xmlcalabash.com/extension/steps/fileutils.xpl' />-->


<!--
PIPELINE BODY
-->
<p:group name='body' xmlns='http://www.w3.org/1999/xhtml'>

<p:xinclude />

<p:delete
match=" processing-instruction('oxygen') |
processing-instruction('xml-stylesheet')
"
/>

<p:xslt>
<p:input port='stylesheet'>
<p:document href='../../../mylib/oxygen/frameworks/docbook5/xsl/DocBook5%20(single%20HTML)%20Custom.xsl' />
</p:input>
<p:input port='parameters'>
<p:empty />
</p:input>
</p:xslt>


<p:group name="xhtml-cleanup">
<p:delete match = 'xhtml:hr' />

<p:rename match = 'xhtml:div[ @class="titlepage" ]'
new-name= 'header'
new-namespace= 'http://www.w3.org/1999/xhtml'
/>

<p:rename match = 'xhtml:div[ matches(@class,"part|chapter|section|glossary|appendix" ) ]'
new-name = 'section'
new-namespace= 'http://www.w3.org/1999/xhtml'
/>

<p:unwrap match = 'xhtml:header//xhtml:div[ not(exists(@class)) ]' />

<p:delete match = 'xhtml:nav//xhtml:*[ @class="toc" ]//xhtml:*[ @class="part" ]//xhtml:*[ @class="chapter" ]//xhtml:*[ @class="section"]//xhtml:ol'/>
<p:delete match = 'xhtml:section[ @class="chapter" ]/xhtml:nav//xhtml:ol//xhtml:ol'/>
<p:delete match = 'xhtml:section/@title|xhtml:*[ @class="book" ]/@title' />

<!--<p:viewport match='xhtml:pre[ contains(@class,"programlisting") ]'>-->
<p:wrap match ='xhtml:pre[ contains(@class,"programlisting") ]'
wrapper ='code'
wrapper-namespace='http://www.w3.org/1999/xhtml' />
<!--
@TODO
Add step(s) to copy the programming language
from pre/@class to code/@class
(leaving 'pre/@class' value 'programlisting' intact)
-->
<!--</p:viewport>-->

<p:insert match='xhtml:head' position='last-child'>
<p:input port="insertion">

<!--<p:inline>
<link rel="stylesheet" type="text/css" href="jquery.snippet.min.css" />
</p:inline>-->
<!--<p:inline>
<script text="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>
</p:inline>-->

<p:inline>
<script type="text/javascript" src="yepnope.1.0.2-min.js"> </script>
</p:inline>
<p:inline>
<script type="text/javascript" src="index.js"> </script>
</p:inline>
</p:input>
</p:insert>

</p:group>


<p:identity name = 'transformed-product' />


<p:store name = 'store-result'
doctype-public = ''
doctype-system = 'about:legacy-compat'
href = 'build/xproc-output.xhtml'
indent = 'true'
omit-xml-declaration= 'false' />

<p:identity>
<p:input port= 'source'>
<p:pipe port= 'result' step= 'transformed-product' />
</p:input>
</p:identity>

</p:group>

</p:declare-step>
Something went wrong with that request. Please try again.