[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Creating multiple xmls using xslt1.0
On Thu, 2012-05-17 at 11:21 +0000, Siddhi Thakkar wrote: > Hi experts, > > I have an xml file like this: [...] > And I have thousands of <Row> elements like this. For the first 50 > rows, I should be able to create an output xml with name Data1.xml, > for next 50 rows output xml should be data2.xml, So there are three parts to this. (1) selecting the right elements, e.g. with Muenchian grouping; (2) generating the file names, probably using position() (3) writing to multiple files, which will require the use of the exslt extensions, or the xt extensions, or XSLT 2, or some other non-XSLT-1.0 approach. With the xt extensions, supported by xt and by libxml, xmlns:xt="http://www.jclark.com/xt" <xsl:template name="write-one-file"> <xsl:param name="what-to-write" /> <xsl:param="filename" /> <xt:document method="html" href="{$filename}"> <xsl:apply-templates select="$what-to-write" /> </xs:document> </xsl:template> But not all processors support that. So best if you mention which XSLT processor you're using. Always best to give people enough information to help you :-) These days I mostly use Saxon and xsl:result-document. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
|
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
|