Re: Fw: Converting to different format
There is a (non-core) exslt:document extension element that does create multiple result documents
IF your XSLT processor supports it (or something similar).
Saxon (pre v8.0) and Xalan (and others) both have extensions that will produce multiple result documents.
XSLT 2.0 has an <xsl:result-document> element ( http://www.w3.org/TR/xslt20/#result-trees )
which will produce multiple result documents.
XSLT 2.0 is still only a Working Draft - and not yet a full Recommendation.
As far as I know Saxon 8.0 is the only XSLT processor that supports XSLT 2.0.
So - to break your main document up into several sub documents - you are looking at an XML processing problem that XSLT is not designed to address yet.
You will either need to write an XSLT stylesheet that you can pass a parameter to specifying which <record> element you want to process
and process your main document with thsi style sheet many times with different parameter values
use some XML (or other) processing to break you main document into sub documents
and use a transformation to format each of your sub documents.
I haven't posted any code for this as I don't know what you are using for XML / XSL processing.
The W3C description of <xsl:result-document> is pretty clear
so - get Saxon 8.0 and try that.
A partial example of an XSLT 1.0 stylesheet with a parameter for the <record> number would be:
<xsl:param name='record_number' select='0'/>
<!-- '0' is a dummy value that will be superceded by the parameter value you pass to your processor -->
<xsl:template match='/'> <xsl:apply-templates select='assets/record[$record_number]'/> </xsl:template>
/ tel :0208-239-6810 mob: 0794-725-9760 email: mike.trotman@xxxxxxxxxxxxx
UK Co. Reg: 4383635 VAT Reg.: 798 7531 60
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