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

Splitting Up XML in many files

Subject: Splitting Up XML in many files
From: "Karl Koch" <TheRanger@xxxxxxx>
Date: Sun, 31 Jul 2005 15:23:19 +0200 (MEST)
xml file splitting
Hello group,

I would like to split up one XML file into many small files. For that, I
would like to use one XML element at the "breakpoint" (in my case, the
"book" tag) along which the file is split up. This also decides on the
number of XML files created (in my case the number of books). The XSLT I
have produced looks like this (following an example from a XSLT book):

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:output method="xml" omit-xml-declaration="yes"/>

  <xsl:template match="book">
    <xsl:variable name="bookNumber"><xsl:number/></xsl:variable>
    <xsl:document  href="{$bookNumber}.xml">
      <xsl:copy-of select="*" />
    </xsl:document>
  </xsl:template>
			
</xsl:stylesheet>

It does not work however. I get an error message saying that my
<xsl:document> tag is not allowed at this position of the stylesheet. I am
using XalanJ 2.5.2. It is not the latest version, I know. It seams Xalan (at
least in this version) does not allow for this operation. 

Does somebody have an idea of another stylesheet which coulid do the job?

If there is no other way, does somebody know if a new version of Xalan could
handle that? Is there any other XSLT Processor which is freely available
which does do that for me? I would prefer of keeping Xalan if possible...

Kind Regards,
Karl


-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

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.