[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsltproc multiple file output

Subject: Re: xsltproc multiple file output
From: Janning Vygen <vygen@xxxxxx>
Date: Thu, 15 May 2003 09:01:59 +0200
xsltproc multiple output
Am Donnerstag, 15. Mai 2003 05:49 schrieb David Pratt:
> I have a file with several figures.  I want to output each as a
> separate html file from a single xml file and single xsl file using
> xsltproc.   I am wanting to title the name of each file with the
> fileref minus the extension  ie. first_figure.jpg page is
> first_figure.html.  Is this possible?
>
>      <figure>
>        <title>title of first figure</title>
>        <mediaobject>
>          <imageobject>
>            <imagedata fileref="first_figure.jpg"
>                       format="JPG" />
>          </imageobject>
>          <caption>
>            <para>This would be the first figure</para>
>          </caption>
>        </mediaobject>
>      </figure>

with xsltproc you can use xsl:document like this:
 
<xsl:template match="figure">
  <xsl:variable name="src" 
       select="mediaobject/imageobject/imagedata/@fileref"/>
  <xsl:variable name="href" value="substring-before($src, '.')"/>
  <xsl:document href="{$href}.html" method="html">
    <html><body><img src="{$src}"/></body></html>
  </xsl:document>
</xsl:template>

just written down. didnt test it. And of course it is not that easy. 
You have to take care about more dots (.) in filenames. More 
imagedata (you might use docbooks mediaselect template) and so on.

kind regards
janning

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.