[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Chunked output with .css and images folder
On Sun, 27 Apr 2003 16:16:59 -0700 David Pratt <fairwinds@shaw.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@vzljot.ru JID: vyt@vzljot.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::*[@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>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]