229 lines
8.3 KiB
XML
229 lines
8.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
<xsl:output method="xml" encoding="UTF-8"/>
|
|
|
|
<xsl:decimal-format name="european" decimal-separator="." grouping-separator=","/>
|
|
|
|
<xsl:param name="mode"/>
|
|
|
|
<xsl:template match="bestelopdracht">
|
|
<!--Facilitor custom XSL template for cXML bestelopdracht-->
|
|
<xsl:element name="cXML">
|
|
<xsl:attribute name="version">1.2.016</xsl:attribute>
|
|
<xsl:attribute name="payloadID">
|
|
<xsl:value-of select="key"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="timestamp">
|
|
<xsl:value-of select="datum/jaar"/>-<xsl:value-of select="datum/maand"/>-<xsl:value-of select="datum/dag"/>T<xsl:value-of select="datum/tijd"/>:00+01:00</xsl:attribute>
|
|
<xsl:attribute name="xml:lang">NL</xsl:attribute>
|
|
<Header>
|
|
<From>
|
|
<xsl:element name="Credential">
|
|
<xsl:attribute name="domain">ArboNed</xsl:attribute>
|
|
<Identity>ArboNed</Identity>
|
|
</xsl:element>
|
|
</From>
|
|
<To>
|
|
<xsl:element name="Credential">
|
|
<xsl:attribute name="domain">
|
|
<xsl:value-of select="bedrijf/naam"/>
|
|
</xsl:attribute>
|
|
<Identity/>
|
|
</xsl:element>
|
|
</To>
|
|
<Sender>
|
|
<Credential domain="Facilitor">
|
|
<Identity/>
|
|
</Credential>
|
|
<UserAgent/>
|
|
</Sender>
|
|
</Header>
|
|
<Request>
|
|
<OrderRequest>
|
|
<xsl:element name="OrderRequestHeader">
|
|
<xsl:attribute name="orderID">
|
|
<xsl:value-of select="id"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="orderDate">
|
|
<xsl:value-of select="datum/jaar"/>-<xsl:value-of select="datum/maand"/>-<xsl:value-of select="datum/dag"/>
|
|
</xsl:attribute>
|
|
<Total>
|
|
<Money currency="EUR">
|
|
<xsl:value-of select="format-number(sum(bestelopdrachtitem/totaal), '0.00', 'european')"/>
|
|
</Money>
|
|
</Total>
|
|
<ShipTo>
|
|
<xsl:element name="Address">
|
|
<xsl:variable name="varNaam">
|
|
<xsl:value-of select="afleveradres/naam"/>
|
|
</xsl:variable>
|
|
<xsl:attribute name="addressID">
|
|
<xsl:value-of select="substring($varNaam,1,5)"/>
|
|
</xsl:attribute>
|
|
<Name xml:lang="NL"><xsl:value-of select="afleveradres/naam"/></Name>
|
|
<PostalAddress>
|
|
<DeliverTo>
|
|
<xsl:value-of select="bestelling/aanvrager/naam_full"/>
|
|
</DeliverTo>
|
|
<xsl:if test="bestelling/plaats != ''">
|
|
<DeliverTo><xsl:value-of select="bestelling/plaats"/>
|
|
</DeliverTo>
|
|
</xsl:if>
|
|
<Street>
|
|
<xsl:value-of select="afleveradres/bezoek_adres"/>
|
|
</Street>
|
|
<City>
|
|
<xsl:value-of select="afleveradres/bezoek_plaats"/>
|
|
</City>
|
|
<State/>
|
|
<PostalCode>
|
|
<xsl:value-of select="afleveradres/bezoek_postcode"/>
|
|
</PostalCode>
|
|
<Country isoCountryCode="NL"/>
|
|
</PostalAddress>
|
|
</xsl:element>
|
|
</ShipTo>
|
|
<BillTo>
|
|
<xsl:element name="Address">
|
|
<xsl:attribute name="addressID">ARBO</xsl:attribute>
|
|
<Name xml:lang="NL">
|
|
<xsl:value-of select="factuuradres/naam"/>
|
|
</Name>
|
|
<PostalAddress>
|
|
<Street>
|
|
<xsl:value-of select="factuuradres/post_adres"/>
|
|
</Street>
|
|
<City>
|
|
<xsl:value-of select="factuuradres/post_plaats"/>
|
|
</City>
|
|
<State/>
|
|
<PostalCode>
|
|
<xsl:value-of select="factuuradres/post_postcode"/>
|
|
</PostalCode>
|
|
<Country isoCountryCode="NL"/>
|
|
</PostalAddress>
|
|
</xsl:element>
|
|
</BillTo>
|
|
<Contact>
|
|
<Name xml:lang="NL">
|
|
<xsl:value-of select="bestelling/aanvrager/naam_full"/>
|
|
</Name>
|
|
<Email>
|
|
<xsl:value-of select="bestelling/aanvrager/email"/>
|
|
</Email>
|
|
</Contact>
|
|
<Extrinsic name="Costcenter">
|
|
<xsl:value-of select="bestelling/kostenplaats/nr"/>
|
|
</Extrinsic>
|
|
<Extrinsic name="Opmerking bestelaanvraag">
|
|
<xsl:value-of select="bestelling/bestel_opm"/>
|
|
</Extrinsic>
|
|
<Extrinsic name="Kenmerken">
|
|
<xsl:for-each select="bestelling/kenmerk">
|
|
<xsl:if test="@type!='Q' and @type!='L'">
|
|
<xsl:element name="Extrinsic">
|
|
<xsl:attribute name="name">
|
|
<xsl:value-of select="@naam"/>
|
|
</xsl:attribute>
|
|
<xsl:value-of select="."/>
|
|
</xsl:element>
|
|
</xsl:if>
|
|
</xsl:for-each>
|
|
</Extrinsic>
|
|
|
|
|
|
|
|
|
|
</xsl:element>
|
|
<xsl:for-each select="bestelopdrachtitem">
|
|
<xsl:sort select="srtdeel/omschrijving"/>
|
|
<xsl:sort select="posnr"/>
|
|
<xsl:element name="ItemOut">
|
|
<xsl:attribute name="quantity">
|
|
<xsl:value-of select="aantal"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="lineNumber">
|
|
<xsl:value-of select="posnr"/>
|
|
</xsl:attribute>
|
|
<xsl:attribute name="requestedDeliveryDate">
|
|
<xsl:value-of select="../bestelling/leverdatum/jaar"/>-<xsl:value-of select="../bestelling/leverdatum/maand"/>-<xsl:value-of select="../bestelling/leverdatum/dag"/>
|
|
</xsl:attribute>
|
|
<ItemID>
|
|
<SupplierPartID>
|
|
<xsl:value-of select="bestelitem/srtdeel/artikel_nummer"/>
|
|
</SupplierPartID>
|
|
</ItemID>
|
|
<ItemDetail>
|
|
<UnitPrice>
|
|
<Money currency="EUR">
|
|
<xsl:value-of select="format-number(prijs, '0.00', 'european')"/>
|
|
</Money>
|
|
</UnitPrice>
|
|
<Description xml:lang="NL">
|
|
<xsl:value-of select="bestelitem/srtdeel/omschrijving"/>
|
|
</Description>
|
|
<UnitOfMeasure>
|
|
<xsl:value-of select="bestelitem/srtdeel/eenheid"/>
|
|
</UnitOfMeasure>
|
|
<CardText>
|
|
<xsl:value-of select="bestelitem/srtdeel/opmerking"/>
|
|
</CardText>
|
|
<Classification domain=""/>
|
|
</ItemDetail>
|
|
</xsl:element>
|
|
</xsl:for-each>
|
|
</OrderRequest>
|
|
</Request>
|
|
</xsl:element>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="facilitor">
|
|
<xsl:apply-templates select="bestelopdracht"/>
|
|
</xsl:template>
|
|
|
|
<xsl:template match="/">
|
|
<xsl:choose>
|
|
<xsl:when test="$mode='getExtension'">
|
|
<xsl:element name="format">
|
|
<xsl:element name="extension">xml</xsl:element>
|
|
</xsl:element>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
|
|
<xsl:apply-templates select="facilitor"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2009. Progress Software Corporation. All rights reserved.
|
|
|
|
<metaInformation>
|
|
<scenarios>
|
|
<scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\TEMP\ARBO_files\bestelopdr8468_20180129123747_224.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="yes" profilemode="0"
|
|
profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no"
|
|
validator="internal" customvalidator="">
|
|
<advancedProp name="bSchemaAware" value="true"/>
|
|
<advancedProp name="xsltVersion" value="2.0"/>
|
|
<advancedProp name="schemaCache" value="||"/>
|
|
<advancedProp name="iWhitespace" value="0"/>
|
|
<advancedProp name="bWarnings" value="true"/>
|
|
<advancedProp name="bXml11" value="false"/>
|
|
<advancedProp name="bUseDTD" value="false"/>
|
|
<advancedProp name="bXsltOneIsOkay" value="true"/>
|
|
<advancedProp name="bTinyTree" value="true"/>
|
|
<advancedProp name="bGenerateByteCode" value="true"/>
|
|
<advancedProp name="bExtensions" value="true"/>
|
|
<advancedProp name="iValidation" value="0"/>
|
|
<advancedProp name="iErrorHandling" value="fatal"/>
|
|
<advancedProp name="sInitialTemplate" value=""/>
|
|
<advancedProp name="sInitialMode" value=""/>
|
|
</scenario>
|
|
</scenarios>
|
|
<MapperMetaTag>
|
|
<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
|
|
<MapperBlockPosition></MapperBlockPosition>
|
|
<TemplateContext></TemplateContext>
|
|
<MapperFilter side="source"></MapperFilter>
|
|
</MapperMetaTag>
|
|
</metaInformation>
|
|
--> |