|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Transforming XML to multiple different versions (m
> -----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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








