<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" encoding="UTF-8"/>

<xsl:decimal-format name="european" decimal-separator='.' grouping-separator=',' />

<xsl:template match="bestelopdracht">
<xsl:element name="eExact">
  <xsl:attribute namespace="http://www.w3.org/2001/XMLSchema-instance" name="xsi:noNamespaceSchemaLocation">eExact-Schema.xsd</xsl:attribute>
	<Orders>
    <xsl:element name="Order">
      <xsl:attribute name="number"></xsl:attribute>
      <xsl:attribute name="type">V</xsl:attribute>
  		<Description><xsl:value-of select="bestelling/kostenplaats/nr"/></Description>
      <YourRef><xsl:value-of select="id"/></YourRef>
      <OrderedBy>
        <Debtor code="220773"> </Debtor>
        <Date><xsl:value-of select="datum/jaar"/>-<xsl:value-of select="datum/maand"/>-<xsl:value-of select="datum/dag"/></Date>
      </OrderedBy>
      <DeliverTo>
        <Debtor code="220773"> </Debtor>
        <Date><xsl:value-of select="bestelling/leverdatum/jaar"/>-<xsl:value-of select="bestelling/leverdatum/maand"/>-<xsl:value-of select="bestelling/leverdatum/dag"/></Date>
      </DeliverTo>
      <InvoiceTo>
        <Debtor code="220773"> </Debtor>
      </InvoiceTo>
      <xsl:element name="Warehouse">
        <xsl:attribute name="code">DS</xsl:attribute>
      </xsl:element>

      <xsl:for-each select="bestelopdrachtitem">
      <xsl:sort select="srtdeel/omschrijving"/>
      <xsl:sort select="posnr"/>
    		<xsl:element name="OrderLine">
          <xsl:attribute name="lineNo"><xsl:value-of select='posnr'/></xsl:attribute>
          <xsl:element name="Item">
            <xsl:attribute name="code"><xsl:value-of select='bestelitem/srtdeel/artikel_nummer'/></xsl:attribute>
          </xsl:element>
          <Quantity><xsl:value-of select='aantal'/></Quantity>
          <Value><xsl:value-of select='prijs'/></Value>
        </xsl:element>
      </xsl:for-each>
    </xsl:element>
	</Orders>
</xsl:element>
</xsl:template>

<xsl:template match="facilitor">
  <xsl:apply-templates select="bestelopdracht"/>
</xsl:template>

<xsl:template match="/">
  <xsl:apply-templates select="facilitor"/>
</xsl:template>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\TEMP\NYBU_files\bestelopdr444_20150217161119.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->