docbook-apps

  • 1.  ant and db5, xinclude and fo output

    Posted 04-10-2008 10:36
    My latest foray into ant:

    Xinclude processing, fo output using xep.

    <path id="xslt.processor.classpath">

    <pathelement path="/myjava/saxon655.jar" />
    <pathelement path="/myjava/resolver.jar"/>
    <pathelement path="${websiteHome}/extensions/saxon64.jar"/>
    <pathelement path="/myjava/xercesImpl.jar"/>
    <pathelement path="/sgml"/>
    </path>






    <target name="docbook" depends="init, clean">

    <java classname="${xslt.processor.class}"
    fork="yes"
    dir="${in.dir}"
    failonerror="true">
    <classpath refid="xslt.processor.classpath" />
    <jvmarg
    line="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
    <jvmarg
    line="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    <jvmarg
    line="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>

    <arg line="-o ${out.dir}/${main.outfile}"/>
    <arg line="-l"/>
    <arg line="-x org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-y org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-r org.apache.xml.resolver.tools.CatalogResolver "/>
    <arg line="${in.dir}/${main.infile} ${main.stylesheet}
    ${param.args.post}" />
    </java>
    <tstamp>
    <format property="fintim" pattern="E @ H:m a" locale="en,UK"/>
    </tstamp>
    <echo>Finished at ${fintim}</echo>
    </target>


    And for the fo, both stages:

    <target name="fo" depends="init, clean.pdf">
    <echo>Generate the fo output</echo>
    <java classname="${xslt.processor.class}"
    fork="yes"
    dir="${in.dir}"
    failonerror="true">
    <classpath refid="xslt.processor.classpath" />
    <jvmarg
    line="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
    <jvmarg
    line="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    <jvmarg
    line="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
    <arg line="-o ${out.fo.dir}/${main.fo.outfile}"/>
    <arg line="-l"/>
    <arg line="-x org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-y org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-r org.apache.xml.resolver.tools.CatalogResolver "/>
    <arg line="${in.dir}/${main.infile} ${main.fo.stylesheet} " />
    </java>
    </target>


    <target name="pdf" depends="fo">
    <echo> Generate the pdf in ${out.fo.dir}</echo>
    <echo>cp is ${fo.processor.class}</echo>
    <java classname="${fo.processor.class}"
    fork='yes'
    dir='${in.dir}'
    failonerror='true'>
    <classpath refid="xslfo.processor.classpath"/>
    <jvmarg line="-Dcom.renderx.xep.CONFIG=${xephome}/xep.xml"/>
    <arg line="-fo ${out.fo.dir}/${main.fo.outfile}"/>
    <arg line="-pdf ${out.fo.dir}/${main.pdf.outfile}"/>
    </java>
    <tstamp>
    <format property="fintim" pattern="E @ H:m a" locale="en,UK"/>
    </tstamp>
    <echo>Finished on ${fintim}</echo>
    </target>



    It might be nicer to use xmllint to expand the includes and validate,
    but I haven't figured out how to get ant to do that.

    Real nasty if (as I did) you have
    book
    chapter
    chapter
    section
    where the chapters (and the section) were xincluded
    Ouch :-) I'd forgotten to wrap the section in a chapter.
    Docbook processes it and the fo processor blows up if it does a
    validation stage, as xep does.
    (Thanks RenderX)


    HTH



    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk



  • 2.  table.cell.border.color not applied in HTML output

    Posted 04-10-2008 16:39
    table.cell.border.color doesn't applied in HTML output. However, it is displaying the expected
    color in FO. The parameter exists in HTML as it is showing here
    http://docbook.sourceforge.net/release/xsl/current/doc/html/table.cell.border.color.html.

    Here is my common customization layer:

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:param name="table.cell.border.color">orange</xsl:param>
    </xsl:stylesheet>


    Does someone know what I did wrong?

    thx!
    Xuan.


    __________________________________________________________________
    Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! Canada Messenger at http://ca.beta.messenger.yahoo.com/




  • 3.  RE: [docbook-apps] table.cell.border.color not applied in HTML output

    Posted 04-17-2008 16:39
    > -----Original Message-----
    > From: Xuan Ngo
    >
    > table.cell.border.color doesn't applied in HTML output.
    > However, it is displaying the expected
    > color in FO. The parameter exists in HTML as it is showing here
    > http://docbook.sourceforge.net/release/xsl/current/doc/html/ta
    > ble.cell.border.color.html.


    You need to turn on the table.borders.with.css parameter to control cell
    borders. See http://www.sagehill.net/docbookxsl/Borders.html.

    /MJ