<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="criteria"/>

<xsl:template match="IDlist">
      <xsl:element name="dossierlist">
      		<xsl:attribute name="startrow"><xsl:value-of select="@startrow"/></xsl:attribute>
      		<xsl:attribute name="rowcount"><xsl:value-of select="@rowcount"/></xsl:attribute>
    		<xsl:attribute name="totalrow"><xsl:value-of select="@totalrow"/></xsl:attribute>
		<!-- xsl:apply-templates select="//ID[number(ID)>=number($startID) and not(number(ID) >number($stopID))]" -->
		<xsl:apply-templates select="//ID">
			<xsl:with-param name="crit" select="$criteria"/>
		 </xsl:apply-templates>
      </xsl:element>
		 
</xsl:template>
 
   <xsl:template match="ID">
    <xsl:param name="crit"/>
	   	<!-- xsl:variable name="XML_content" select="document(concat('cocoon://FLWB/dossier.xml?dossierID=',.)  )//DOSSIER[number(./DEPOT) > 20020600]"/ -->
		<!-- xsl:variable name="XML_content" select="document(concat('cocoon://FLWB/dossier.xml?dossierID=',.)  )//FLWBDOC[contains(./COMPET,'78')]"/ -->
		<!-- xsl:variable name="XML_content" select="document(concat('cocoon://FLWB/dossier.xml?dossierID=',.)  )//FLWBDOC[contains(.,'BUITENLANDSE BETREKKINGEN')]"/ -->
		<!-- xsl:variable name="XML_content" select="document(concat('cocoon://FLWB/dossier.xml?dossierID=',.)  )//FLWBDOC[contains(./VOTEK,'200105')]"/ -->
		
		<xsl:variable name="ID" select="substring-after(.,'K')"/>
		<xsl:variable name="legisl" select="substring-before(.,'K')"/>		
		<xsl:variable name="XML_content" select="document( concat('cocoon://FLWB/dossierlight.xml?dossierID=',$ID,'&#38;legislat=',$legisl)    )//DOSSIER[contains(.,$crit)]"/> 
		<!-- xsl:variable name="XML_content" select="document( concat('cocoon://FLWB/dossier.xml?dossierID=',$ID)     )//DOSSIER"/ --> 

		<xsl:copy-of select="$XML_content"/>
		
 </xsl:template>
 
</xsl:stylesheet>