This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: divide info in several output files


try these XML's and XSL's
solution posted a few days back

XSL :
-----------

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:param name="number">2</xsl:param>

<xsl:template match="category">
		<html>
		<title> hello </title>
			<body>
				<xsl:apply-templates select="file[position() mod $number = 4]"/>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="file">
		<category1>
			<!--xsl:apply-templates/-->
			<xsl:copy-of select=".| following-sibling::file[position() &lt;
$number]"/>
		</category1>
	</xsl:template>
</xsl:stylesheet>


XML:
------------

<?xml version="1.0"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="category.xsl" type="text/xsl"?>
<category>
	<file>file1</file>
	<file>file2</file>
	<file>file3</file>
	<file>file4</file>
	<file>file5</file>
	<file>file6</file>
	<file>file7</file>
	<file>file8</file>
	<file>file9</file>
	<file>file10</file>
	<file>file11</file>
	<file>file12</file>
	<file>file13</file>
	<file>file14</file>
	<file>file15</file>
	<file>file16</file>
	<file>file17</file>
	<file>file18</file>
	<file>file19</file>
	<file>file20</file>
	<file>file21</file>
	<file>file22</file>
	<file>file23</file>
	<file>file24</file>
	<file>file25</file>
	<file>file26</file>
	<file>file27</file>
</category>

Keep on changing the value of  $number  to  get as many entries per page as
you want.

cheers

Tapan Nanawati
tapan_nanawati@yahoo.com
91-11-6685274 (o)
91-98112-98982 (m)
New Delhi - INDIA
------------------------------
God is real, unless declared integer.


$-----Original Message-----
$From: owner-xsl-list@lists.mulberrytech.com
$[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Aniceto López
$Sent: Thursday, March 01, 2001 9:30 PM
$To: XSL-List@lists.mulberrytech.com
$Subject: [xsl] divide info in several output files
$
$
$hello everybody;
$
$I don`t know how to face this problem:
$
$one xml file with a long list of items (28 i.e.)
$<whatever>
$  <anything>ryur54wrthigyuif</anything>
$  <anything>ryureicnsd45gkjuif</anything>
$  <anything>ihdftuiwtusd78yrt</anything>
$  <anything>..................
$</whatever>
$
$I need to output a html with a few (10 i.e.) of this itens
$and a link to other page containing the next 10 and
$so on til the last page including the last 8 items.
$
$The quantity of items can be different from one xml file
$to another so no quantity-dependant-solution
$
$is there any idea/solution for this?
$thanks in advance
$
$ani lopez
$
$
$
$
$
$ XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]