xsl-list
[Top] [All Lists]

Splitting Up XML in many files

2005-07-31 06:23:19
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>