[oXygen-user] how to customize the docbook-to-epub ant script?

Radu Coravu radu_coravu at sync.ro
Tue Sep 27 00:43:20 CDT 2011


Hi Robert,

Please see some answers below:

> First, I'd  like to have access to several different versions of the
> Docbook stylesheets  (i.e.,: snapshot, latest-docbook,
> latest-docbook-ns).  I guess I'm reaching the conclusion that the
> Oxygen ant script would not help me  because i need to change the XSL
> references.
> At the same time, it's a good model, and I'm wondering if I  should
> copy  those extra XSL files (e AddImagesContentOpf.xsl, copy.xsl,
> images.xsl, removeImagesContentOpf.xsl ) into a folder of each Docbook
> XSL I will be using. (The image handling parts are the most
> important/difficult parts of making the epub file).
>
> Do you have any thoughts about this?

You can modify the build file to your needs of course.
For example you can add it as a parameter the path to the custom XSL file.

> One other thing. You mention that the ant is running a profiling
> stylesheet. I've run two pass profiling before, but I'm not sure how
> Ant fits into this. Is the build script creating an xml output from a
> profiling XSL and using it as input for the final epub transformation?

Yes, exactly.

> (I assume this output-from-profiing.xml  file is temporary; is it
> deleted at some point, or is there a way to keep it so  I can inspect
> it?

Yes, it gets deleted in the build file:

> OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/epub/bin/build.xml

at the line:

> <delete file="${xincluded-profiled.xml}"/>


Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


On 9/26/2011 7:31 PM, Robert Nagle wrote:
> This raises two questions.
>
> First, I'd  like to have access to several different versions of the
> Docbook stylesheets  (i.e.,: snapshot, latest-docbook,
> latest-docbook-ns).  I guess I'm reaching the conclusion that the
> Oxygen ant script would not help me  because i need to change the XSL
> references.
>
> At the same time, it's a good model, and I'm wondering if I  should
> copy  those extra XSL files (e AddImagesContentOpf.xsl, copy.xsl,
> images.xsl, removeImagesContentOpf.xsl ) into a folder of each Docbook
> XSL I will be using. (The image handling parts are the most
> important/difficult parts of making the epub file).
>
> Do you have any thoughts about this?
>
> One other thing. You mention that the ant is running a profiling
> stylesheet. I've run two pass profiling before, but I'm not sure how
> Ant fits into this. Is the build script creating an xml output from a
> profiling XSL and using it as input for the final epub transformation?
>
> (I assume this output-from-profiing.xml  file is temporary; is it
> deleted at some point, or is there a way to keep it so  I can inspect
> it?
>
> Thanks.
>
> Robert
>
> On Mon, Sep 26, 2011 at 7:23 AM, Radu Coravu<radu_coravu at sync.ro>  wrote:
>> Hi Robert,
>>
>> You should probably start by reading this forum post:
>>> http://www.oxygenxml.com/forum/post19071.html?hilit=docbook%20epub#p19071
>>
>> So right now there are two main XSLT steps when creating the EPUB
>> output. First a Docbook profiling stylesheet is applied over the edited
>> XML in order to obtain the filtered XML and then the filtered XML is
>> transformed against the Docbook XSL to obtain the chunked HTML output.
>>
>> Regards,
>> Radu
>>
>> Radu Coravu
>> <oXygen/>    XML Editor, Schema Editor and XSLT Editor/Debugger
>> http://www.oxygenxml.com
>>
>>
>> On 9/26/2011 9:35 AM, Robert Nagle wrote:
>>> I am trying to customize the ant-build script for docbook epub so that
>>> the customizations and the epub stylesheets are in my Windows user
>>> directories rather than in the system directories. for example I want
>>> to use the latest snapshot instead of the version which comes with
>>> Oxygen. Namely:
>>>
>>> my snapshot of docbook xsl:  I:\My Documents\1latest\docbook-xsl-snapshot
>>> xml/xsl source to be here: I:\My Documents\My Dropbox\xml
>>> build.xml file is currently here C:\Program Files (x86)\Oxygen XML
>>> Editor 13\frameworks\docbook\xsl\epub\bin
>>>
>>> Could I still use this build.xml file in modified form? In which
>>> directory  would be the best place to put the build.xml file?
>>>
>>> Should I copy the AddImagesContentOpf.xsl, copy.xsl, images.xsl,
>>> removeImagesContentOpf.xsl into I:\My
>>> Documents\1latest\docbook-xsl-snapshot\epub ?
>>>
>>> If I kept the build.xml file in my project directory I:\My
>>> Documents\My Dropbox\xml\ , which references would I need to fix? For
>>> example, I see
>>>
>>> <xmlcatalog>
>>>           <catalogpath>
>>>             <pathelement location="../../../catalog.xml"/>
>>>           </catalogpath>
>>>         </xmlcatalog>
>>>
>>> in the build.xml file. I'm not sure where this catalog.xml file ought
>>> to reside.
>>>
>>> Finally in build.xml I see
>>>
>>>       <xslt in="${xmlFile}" out="${xincluded-profiled.xml}"
>>> style="../../profiling/profile.xsl"
>>>         classpath="classpath">
>>>         <!--OXYGEN PATCH for EXM-19733-->
>>>         <xmlcatalog>
>>>           <catalogpath>
>>>             <pathelement location="../../../catalog.xml"/>
>>>           </catalogpath>
>>>         </xmlcatalog>
>>>         <sysproperty key="org.apache.xerces.xni.parser.XMLParserConfiguration"
>>>           value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
>>>         <param name="profile.arch" expression="${profile.arch}"
>>> if="profile.arch"/>
>>>         <param name="profile.audience" expression="${profile.audience}"
>>> if="profile.audience"/>
>>>         <param name="profile.condition"
>>> expression="${profile.condition}" if="profile.condition"/>
>>>         <param name="profile.conformance"
>>> expression="${profile.conformance}" if="profile.conformance"/>
>>>         <param name="profile.lang" expression="${profile.lang}"
>>> if="profile.lang"/>
>>>         <param name="profile.os" expression="${profile.os}" if="profile.os"/>
>>>         <param name="profile.revision" expression="${profile.revision}"
>>> if="profile.revision"/>
>>>         <param name="profile.revisionflag"
>>> expression="${profile.revisionflag}" if="profile.revisionflag"/>
>>>         <param name="profile.role" expression="${profile.role}"
>>> if="profile.role"/>
>>>         <param name="profile.security" expression="${profile.security}"
>>> if="profile.security"/>
>>>         <param name="profile.status" expression="${profile.status}"
>>> if="profile.status"/>
>>>         <param name="profile.userlevel"
>>> expression="${profile.userlevel}" if="profile.userlevel"/>
>>>         <param name="profile.vendor" expression="${profile.vendor}"
>>> if="profile.vendor"/>
>>>         <param name="profile.wordsize" expression="${profile.wordsize}"
>>> if="profile.wordsize"/>
>>>         <param name="profile.attribute"
>>> expression="${profile.attribute}" if="profile.attribute"/>
>>>         <param name="profile.value" expression="${profile.value}"
>>> if="profile.value"/>
>>>       </xslt>
>>>
>>> I'm not sure what this is supposed to do. Isn't this stuff I can
>>> already  control from my docbook xsl customization layer? Why is it
>>> mentioned here?
>>>
>>> Thanks for your help.
>>>
>>>
>>
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>
>
>
>




More information about the oXygen-user mailing list