<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:web="http://www.webwinkel.nl" exclude-result-prefixes="web">
	
	<xsl:template match="/">
		
		<order xmlns="http://www.groothandel.nl" 
			      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
			      xsi:schemaLocation="http://www.groothandel.nl file:///H:/XMLbestanden/Groothandel.xsd">
			<contactpersoon>Piet Paulusma</contactpersoon>
			<xsl:for-each select="document('H:\XMLbestanden\webbestelling.xml')/web:bestelling/web:product">
					<productid>
						<xsl:choose>
							<xsl:when test="web:productid='B-431'">ws-434</xsl:when>
							<xsl:when test="web:productid='B-432'">th-111</xsl:when>
							<xsl:when test="web:productid='B-433'">rg-212</xsl:when>
							<xsl:when test="web:productid='B-434'">wm-212</xsl:when>
							<xsl:otherwise>??-???</xsl:otherwise>
						</xsl:choose>
					</productid>
					<aantal>
						<xsl:value-of select="web:aantal"/>
					</aantal>
			</xsl:for-each>
			<datum>
				<xsl:value-of select="concat(web:bestelling/web:datum/web:jaar,'-',web:bestelling/web:datum/web:maand,'-',web:bestelling/web:datum/web:dag)"/>
			</datum>
			<klantid>23451</klantid>
		</order>
	</xsl:template>
</xsl:stylesheet>			