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

RE: Transforming XML to multiple different versions (m

Subject: RE: Transforming XML to multiple different versions (multiple files)
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Thu, 4 Mar 2004 22:01:22 +0100
xml multiple xsl
> -----Original Message-----
> From: Richard Corfield
>
<snip />

Hi,

> I have worked out how to output the <chapter> elements to
> multiple files, but I'm having trouble copy ing the preceding and
> following parts of the xml. Here is a snippet of the XSL I have
> been working with: (I'm using XML::LibXSLT to do the transform)
>

Since it appears that the relevant data is always in the same position
relative to the chapter elements, I'd guess something like this would do it

...
<!-- global -->
<xsl:variable name="vmeta" select="book/metadata" />
<xsl:variable name="vbook" select="book/bookdata/*[not(name(.)='contents')]"
/>
...
<xsl:template match="chapter">
  <xsl:document href="...">
    <book ref="ancestor::book/@id">
      <xsl:copy-of select="$vmeta" />
      <bookdata>
        <xsl:copy-of select="$vbook" />
        <contents pdf="parent::contents/@pdf">
          <xsl:copy-of select="." />
        </contents>
      </bookdata>
    </book>
  </xsl:document>
</xsl:template>

However, last time I checked, XSLT 1.0 didn't support multidoc output unless
extensions are used..


Hope this helps!

Cheers,

Andreas


 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.