Blame Scripts/Functions/Render/Backends/Docbook/docbook_convertToXhtml.sh

e8c00e
#!/bin/bash
e8c00e
#
ee2e91
# render_docbook_convertToXhtml.sh -- This function uses DocBook XML
ee2e91
# as input and applies XSL stylesheets to produce a big XHTML files as
ee2e91
# output.  The procedure was taken from the documentation of
e8906a
# `docbook-style-xsl-1.69.1-5.1' package, which says: ---To publish
be62ec
# HTML from your XML documents, you just need an XSL engine.---.
e8c00e
#
3b0984
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# WITHOUT ANY WARRANTY; without even the implied warranty of
e8c00e
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
e8c00e
# General Public License for more details.
e8c00e
#
e8c00e
# You should have received a copy of the GNU General Public License
e8c00e
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
e8c00e
# ----------------------------------------------------------------------
e8c00e
# $Id$
e8c00e
# ----------------------------------------------------------------------
e8c00e
e8906a
function docbook_convertToXhtml {
e8c00e
be62ec
    local -a XSL_TEMPLATE
be62ec
    local -a XSL_INSTANCE
be62ec
    local XSL_INSTANCE_FINAL=''
be62ec
e8c00e
    # Print action message.
e8c00e
    if [[ -f ${FILE}.xhtml ]];then
0ff158
        cli_printMessage "${FILE}.xhtml" --as-updating-line
e8c00e
    else
0ff158
        cli_printMessage "${FILE}.xhtml" --as-creating-line
e8c00e
    fi
e8c00e
e8906a
    # Define absolute path to DocBook source file. This is the
e8906a
    # repository documentation manual file where DOCTYPE and ENTITY
e8906a
    # definition lines are set.
e8906a
    local SRC=${INSTANCE}
e8c00e
e8906a
    # Define absolute path to PDF target file. This is the final
e8906a
    # location the PDF file produced as result of DocBook to PDF
e8906a
    # transformation will be stored in.
e8906a
    local DST="${FILE}.xhtml"
e8906a
be62ec
    # Prepare XSL final instances used in transformations.
be62ec
    ${RENDER_BACKEND}_prepareXsl4Using $(cli_getFilesList \
be62ec
        ${RENDER_DOCBOOK_XSLDIR} --pattern='.*docbook2xhtml-(single|common)\.xsl')
e8906a
e8906a
    # Transform DocBook XML to XHTML supressing all stderr output.
be62ec
    xsltproc --output ${DST} ${XSL_INSTANCE_FINAL} ${SRC} &> /dev/null
be62ec
be62ec
    # Remove XSL instance files.
be62ec
    rm ${XSL_INSTANCE[*]}
e8c00e
e8c00e
}