Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] chunking a very large xml document

From: "Michael Kay" <mhk@--------->
To:
Date: 7/2/2004 2:56:00 PM
In XSLT 2.0 this is:

<xsl:template match="product">
<products>
  <xsl:apply-templates/>
</products>
</xsl:template>

<xsl:template match="record">
  <file name="{@id}.xml"/>
  <xsl:result-document href="{@id}.xml">
    <xsl:copy-of select="."/>
  </xsl:result-document>
</xsl:template>

If you're using an XSLT 1.0 processor, then xsl:result-document won't be
available, and you'll have to use the custom extension that comes with your
chosen product, which will vary from one product to another.

Michael Kay 

> -----Original Message-----
> From: Munna D [mailto:munna@xxxxxxxxxx] 
> Sent: 02 July 2004 13:40
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] chunking a very large xml document
> 
> I have a single large xml file of the following structure:
> 
> <product id="m001">
> 	<record id="m002">
> 		<el1>aaa</el1>
> 		<el2>bbb</el2>
> 	</record>
> 	
> 	<record id="m003">
> 		<el1>ccc</el1>
> 		<el2>ddd</el2>
> 	</record>
> </product>
> 
> I would like to split this up, so that 
> (1) each record is saved as a separate file named [value-of-id].xml
> (2) each of these new files should have a doctype declaration 
> (ideally one I can change with a parameter)
> (3) a manifest file is generated with a list of all record 
> files produced.
> 
> I realise this is something like what the chunking 
> stylesheets achieve in docbook, but those are so complex that 
> a newbie like me can't really understand where to start 
> adapting them. I would be really grateful for any pointers or 
> example stylesheets that you may have.
> 
> Many thanks,
> 
> Munna
> -- 
> ___________________________________________________________
> Sign-up for Ads Free at Mail.com
> http://promo.mail.com/adsfreejump.htm
> 
> 
> --+------------------------------------------------------------------
> 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@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent