This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Re: Chunked output with .css and images folder
- From: Vitaly Ostanin <vyt at vzljot dot ru>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Tue, 29 Apr 2003 11:18:37 +0400
- Subject: [docbook-apps] Re: Chunked output with .css and images folder
- References: <58BDB9F4-7906-11D7-B84C-000A27B3B070@shaw.ca>
On Sun, 27 Apr 2003 16:16:59 -0700
David Pratt <fairwinds at shaw dot ca> wrote:
> I am chunking xml to xhtml and trying to get my stylesheet and
> image folder all work out with my customization layer.
<skipped/>
> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
> "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
> <!ENTITY book SYSTEM "book.xml">
> <!ENTITY version "1.0">
> <!ENTITY releasedate "May 30, 2003">
> <!ENTITY % chapter01 SYSTEM "entities/chapter01.ent">
> <!ENTITY % chapter02 SYSTEM "entities/chapter02.ent">
> %chapter01;
> %chapter02;
> ]>
> <book><title>My Book Title Here</title>
> &book;
> </book>
<skipped/>
> Any advice much appreciated.
You can use modular schema for developing documents and XML
Inclusions for merging, see
http://www.sagehill.net/xml/docbookxsl/ModularDoc.html
After processing all documents tree in one all included parts
will have "xml:base" attribute. You can use value of this
attribute for calculate relative paths to images and copy images
to output directory.
XSLT-style for it is attached (works with libxml2-2.4.30 and
libxslt-1.0.23). Style support only <graphic/>, but you can easy
add support for other tags.
<skipped/>
--
Regards, Vyt
mailto: vyt at vzljot dot ru
JID: vyt at vzljot dot ru
<?xml version='1.0' encoding="windows-1251"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- $Id: collect_images.xsl,v 1.1 2003/02/28 09:56:23 vyt Exp $ -->
<!--
Ñòèëü äëÿ ñáîðà èçîáðàæåíèé èç äîêóìåíòîâ. Âûâîäèò ïîëíûå ïóòè ê êàðòèíêàì ÷åðåç ïðîáåë.
-->
<xsl:output encoding="windows-1251" method="text"/>
<xsl:template name="strip-filename">
<xsl:param name="filename"/>
<xsl:if test="contains($filename,'/')">
<xsl:value-of select="substring-before($filename,'/')"/>
<xsl:text>/</xsl:text>
<xsl:call-template name="strip-filename">
<xsl:with-param name="filename" select="substring-after($filename,'/')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="graphic">
<xsl:call-template name="strip-filename">
<xsl:with-param name="filename" select="ancestor-or-self::*[ at xml:base][position()=1]/@xml:base"/>
</xsl:call-template>
<xsl:value-of select="@fileref"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="*|@*|text()">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org