xsl1.0: xml node name based on value in other tag

Hello, in incoming xml I have total amount value; if value is gt 0; the document is invoice; if it is lt 0; it is credit invoice.

The outgoing xml needs different names on tags if invoice or credit note.

I tried like this; but get
  "Expected white space"
when running in Stylus:

<xsl:variable name="MAINHEADER">
      <xsl:choose>
            <xsl:when test="INVOIC/OrderHead/Ord_4182 &lt; 0">
                  <xsl:value-of select="'<CreditNote xmlns=""urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"" xmlns:cac=""urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"" xmlns:cbc=""urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"" xmlns:ccts=""urn:un:unece:uncefact:documentation:2"" xmlns:ext=""urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">'"/>
            </xsl:when>
            <xsl:otherwise>
                  <xsl:value-of select="'<inv:Invoice xmlns:inv=""urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"" xmlns:ext=""urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"" xmlns:cbc=""urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"" xmlns:cac=""urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">'"/>
            </xsl:otherwise>
      </xsl:choose>
      </xsl:variable>

Error message says whitespace should be here (marked bold):
<xsl:value-of select="'<CreditNote

What am I missing?
trygvesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
If you want the element generated, you don't need to use value-of (because that would only create a textnode incidentaly starting with "<")
You need to put down the <inv:Invoice in literal nodes

It is pretty hard to do so in a variable
but you can put the elemant name in a variable and use xsl:element
Gertone (Geert Bormans)Information ArchitectCommented:
Can you put an example XML and your full XSLT?
Then I could show you how you can do this

Put the choose on the top level (don't use a variable) and do an apply-templates for the other nodes from within the choose

Here is how I would get started with this

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="/">
      <xsl:choose>
            <xsl:when test="INVOIC/OrderHead/Ord_4182 &lt; 0">
                  <CreditNote xmlns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                  <xsl:apply-templates/>
                  </CreditNote>
            </xsl:when>
            <xsl:otherwise>
                  <inv:Invoice xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <xsl:apply-templates/>
                </inv:Invoice>
            </xsl:otherwise>
      </xsl:choose>
      </xsl:variable>
</xsl:template>

<!-- templates for child elements go here -->

</xsl:stylesheet>

Open in new window

trygvesAuthor Commented:
Thanks, here are my files :)
ehf.xsl
incoming.xml
Gertone (Geert Bormans)Information ArchitectCommented:
Here is what I would do
For the Invoice the result definitely is the same

<?xml version='1.0' encoding='windows-1252' ?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" 
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" 
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" 
xmlns:cred="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" 
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
>
	<xsl:output method="xml" indent="yes"/>
	<xsl:decimal-format name="european" decimal-separator="."/>
	<xsl:key name="OrdlnVatNo" match="OrderLine" use="OrdLn_VatNo"/>
	<xsl:variable name="ISOcurrency">
		<xsl:choose>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 45">
				<xsl:value-of select="'DKK'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 298">
				<xsl:value-of select="'DKK'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 358">
				<xsl:value-of select="'EUR'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 49">
				<xsl:value-of select="'EUR'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 299">
				<xsl:value-of select="'DKK'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 354">
				<xsl:value-of select="'ISK'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 47">
				<xsl:value-of select="'NOK'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 46">
				<xsl:value-of select="'SEK'"/>
			</xsl:when>
			<xsl:when test="INVOIC/OrderHead/Ord_Cur = 44">
				<xsl:value-of select="'GBP'"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="'NOK'"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:variable name="OrderNo" select="INVOIC/OrderHead/Ord_OrdNo"/>
		<xsl:template match="/">
		      <xsl:choose>
            <xsl:when test="INVOIC/OrderHead/Ord_4182 &lt; 0">
                  <cred:CreditNote xmlns:cred="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                 <xsl:apply-templates select="INVOIC"/>
                  </cred:CreditNote>
            </xsl:when>
            <xsl:otherwise>
                  <inv:Invoice xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                 <xsl:apply-templates select="INVOIC"/>
                </inv:Invoice>
            </xsl:otherwise>
      </xsl:choose>
	</xsl:template>
	
	<xsl:template match="INVOIC">
			<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
			<cbc:CustomizationID>urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0:extended:urn:www.difi.no:ehf:faktura:ver2.0</cbc:CustomizationID>
			<cbc:ProfileID>urn:www.cenbii.eu:profile:bii05:ver2.0</cbc:ProfileID>
			<cbc:ID>
				<xsl:value-of select="OrderHead/Ord_InvoNo"/>
			</cbc:ID>
			<cbc:IssueDate>
				<xsl:value-of select="concat(substring(OrderHead/Ord_LstInvDt,1,4),'-',substring(OrderHead/Ord_LstInvDt,5,2),'-',substring(OrderHead/Ord_LstInvDt,7,2))"/>
			</cbc:IssueDate>
			<cbc:InvoiceTypeCode listID="UNCL1001">
				<xsl:choose>
					<xsl:when test="OrderHead/Ord_4182 &lt; 0">
						<xsl:value-of select="'381'"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:choose>
							<xsl:when test="OrderHead/Ord_FactNo = ''">
								<xsl:value-of select="'380'"/>
							</xsl:when>
							<xsl:when test="OrderHead/Ord_FactNo != ''">
								<xsl:value-of select="'393'"/>
							</xsl:when>
						</xsl:choose>
					</xsl:otherwise>
				</xsl:choose>
			</cbc:InvoiceTypeCode>
			<cbc:DocumentCurrencyCode listID="ISO4217">
				<xsl:value-of select="$ISOcurrency"/>
			</cbc:DocumentCurrencyCode>
			<cac:OrderReference>
				<cbc:ID>
					<xsl:choose>
						<xsl:when test="OrderHead/Ord_YrRef = ''">Ukjent</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="OrderHead/Ord_YrRef"/>
						</xsl:otherwise>
					</xsl:choose>
				</cbc:ID>
			</cac:OrderReference>
			<cac:ContractDocumentReference>
				<cbc:ID><xsl:text>Not available</xsl:text></cbc:ID>
			</cac:ContractDocumentReference>
			<cac:AdditionalDocumentReference>
				<cbc:ID>PDF Invoice</cbc:ID>
				<cac:Attachment>
					<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf">
					<xsl:value-of select="OrderHead/base64"/>
					</cbc:EmbeddedDocumentBinaryObject>
				</cac:Attachment>
			</cac:AdditionalDocumentReference>
			<cac:AccountingSupplierParty>
				<cac:Party>
					<cbc:EndpointID schemeID="NO:ORGNR">
						<xsl:value-of select="OrderHead/FrmData_EANLocCd"/>
					</cbc:EndpointID>
					<cac:PartyIdentification>
						<cbc:ID schemeID="NO:ORGNR">
							<xsl:value-of select="OrderHead/FrmData_EANLocCd"/>
						</cbc:ID>
					</cac:PartyIdentification>
					<cac:PartyName>
						<cbc:Name>
							<xsl:value-of select="OrderHead/Frm_Nm"/>
						</cbc:Name>
					</cac:PartyName>
					<cac:PostalAddress>
						<cbc:StreetName>
							<xsl:value-of select="OrderHead/FrmData_Ad1"/>
						</cbc:StreetName>
						<cbc:CityName>
							<xsl:value-of select="OrderHead/FrmData_PArea"/>
						</cbc:CityName>
						<cbc:PostalZone>
							<xsl:value-of select="OrderHead/FrmData_PNo"/>
						</cbc:PostalZone>
						<cac:Country>
							<cbc:IdentificationCode listID="ISO3166-1:Alpha2">NO</cbc:IdentificationCode>
						</cac:Country>
					</cac:PostalAddress>
					<cac:PartyTaxScheme>
						<cbc:CompanyID schemeID="NO:VAT" schemeAgencyID="82">
							<xsl:value-of select="OrderHead/FrmData_EANLocCd"/><xsl:text>MVA</xsl:text>
						</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
					<cac:PartyLegalEntity>
						<cbc:RegistrationName>
							<xsl:value-of select="OrderHead/Frm_Nm"/>
						</cbc:RegistrationName>
						<cbc:CompanyID schemeID="NO:ORGNR">
							<xsl:value-of select="OrderHead/FrmData_EANLocCd"/>
						</cbc:CompanyID>
					</cac:PartyLegalEntity>
					<cac:Contact>
						<cbc:ID>
							<xsl:value-of select="OrderHead/Ord_OurRef"/>
						</cbc:ID>
						<cbc:Name>
							<xsl:value-of select="OrderHead/Ord_OurRef"/>
						</cbc:Name>
						<cbc:Telephone>
							<xsl:value-of select="OrderHead/Frm_Phone"/>
						</cbc:Telephone>
						<cbc:ElectronicMail>
							<xsl:value-of select="OrderHead/Frm_Email"/>
						</cbc:ElectronicMail>
					</cac:Contact>
				</cac:Party>
			</cac:AccountingSupplierParty>
			<cac:AccountingCustomerParty>
				<cac:Party>
					<cbc:EndpointID schemeID="NO:ORGNR">
						<xsl:choose>
							<xsl:when test="OrderHead/InvoiceCustomer_BsNo != ''">
								<xsl:value-of select="OrderHead/InvoiceCustomer_BsNo"/>
							</xsl:when>
							<xsl:otherwise/>
						</xsl:choose>
					</cbc:EndpointID>
					<cac:PartyIdentification>
						<cbc:ID schemeID="GLN">
							<xsl:choose>
								<xsl:when test="OrderHead/InvoiceCustomer_BsNo != ''">
									<xsl:value-of select="OrderHead/InvoiceCustomer_BsNo"/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="OrderHead/EANInvoNo"/>
								</xsl:otherwise>
							</xsl:choose>
						</cbc:ID>
					</cac:PartyIdentification>
					<cac:PartyName>
						<cbc:Name>
							<xsl:value-of select="OrderHead/Ord_InvoCustNm"/>
						</cbc:Name>
					</cac:PartyName>
					<cac:PostalAddress>
						<cbc:StreetName>
							<xsl:value-of select="OrderHead/Ord_InvoCustAd1"/>
						</cbc:StreetName>
						<cbc:CityName>
							<xsl:value-of select="OrderHead/Ord_PArea"/>
						</cbc:CityName>
						<cbc:PostalZone>
							<xsl:value-of select="OrderHead/Ord_PNo"/>
						</cbc:PostalZone>
						<cac:Country>
							<cbc:IdentificationCode listID="ISO3166-1:Alpha2">
								<xsl:value-of select="OrderHead/InvoiceCustomer_ISOCode"/>
							</cbc:IdentificationCode>
						</cac:Country>
					</cac:PostalAddress>
					<cac:PartyTaxScheme>
						<cbc:CompanyID schemeID="NO:VAT" schemeAgencyID="82">
							<xsl:choose>
								<xsl:when test="OrderHead/InvoiceCustomer_BsNo != ''">
									<xsl:value-of select="OrderHead/InvoiceCustomer_BsNo"/><xsl:text>MVA</xsl:text>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="OrderHead/EANInvoNo"/>
								</xsl:otherwise>
							</xsl:choose>
						</cbc:CompanyID>
						<cac:TaxScheme>
							<cbc:ID>VAT</cbc:ID>
						</cac:TaxScheme>
					</cac:PartyTaxScheme>
					<cac:PartyLegalEntity>
						<cbc:RegistrationName>
							<xsl:value-of select="OrderHead/Ord_Nm"/>
						</cbc:RegistrationName>
						<cbc:CompanyID schemeID="NO:ORGNR">
							<xsl:choose>
								<xsl:when test="OrderHead/InvoiceCustomer_BsNo != ''">
									<xsl:value-of select="OrderHead/InvoiceCustomer_BsNo"/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="OrderHead/InvoiceCustomer_BsNo"/>
								</xsl:otherwise>
							</xsl:choose>
						</cbc:CompanyID>
					</cac:PartyLegalEntity>
					<xsl:choose>
						<xsl:when test="OrderHead/LiaisonActor_Name != ''">
							<cac:Contact>
								<cbc:ID>
									<xsl:value-of select="OrderHead/LiaisonActor_Name"/>
								</cbc:ID>
								<cbc:Name>
									<xsl:value-of select="OrderHead/LiaisonActor_Name"/>
								</cbc:Name>
							</cac:Contact>
						</xsl:when>
						<xsl:otherwise>
							<cac:Contact>
								<xsl:choose>
									<xsl:when test="OrderHead/Ord_YrRef = ''">
										<cbc:ID>n/a</cbc:ID>
									</xsl:when>
									<xsl:otherwise>
										<cbc:ID>
											<xsl:value-of select="OrderHead/Ord_YrRef"/>
										</cbc:ID>
									</xsl:otherwise>
								</xsl:choose>
							</cac:Contact>
						</xsl:otherwise>
					</xsl:choose>
				</cac:Party>
			</cac:AccountingCustomerParty>
			<xsl:if test="OrderHead/Ord_CfDelDt != 0 or OrderHead/Ord_DelActNo != 0">
				<cac:Delivery>
					<xsl:if test="OrderHead/Ord_CfDelDt != 0">
						<cbc:ActualDeliveryDate>
							<xsl:value-of select="concat(substring(OrderHead/Ord_CfDelDt,1,4),'-',substring(OrderHead/Ord_CfDelDt,5,2),'-',substring(OrderHead/Ord_CfDelDt,7,2))"/>
						</cbc:ActualDeliveryDate>
					</xsl:if>
					<xsl:if test="OrderHead/Ord_DelActNo != 0">
						<cac:DeliveryLocation>
							<cbc:ID schemeID="GSRN"/>
							<cac:Address>
								<cbc:StreetName>
									<xsl:value-of select="OrderHead/Ord_DelAd1"/>
								</cbc:StreetName>
								<cbc:AdditionalStreetName>
									<xsl:value-of select="OrderHead/Ord_DelAd2"/>
								</cbc:AdditionalStreetName>
								<cbc:CityName>
									<xsl:value-of select="OrderHead/Ord_DelPArea"/>
								</cbc:CityName>
								<cbc:PostalZone>
									<xsl:value-of select="OrderHead/Ord_DelPNo"/>
								</cbc:PostalZone>
								<cac:Country>
									<cbc:IdentificationCode listID="ISO3166-1:Alpha2">
										<xsl:value-of select="OrderHead/InvoiceCustomer_ISOCode"/>
									</cbc:IdentificationCode>
								</cac:Country>
							</cac:Address>
						</cac:DeliveryLocation>
					</xsl:if>
				</cac:Delivery>
			</xsl:if>
			<cac:PaymentMeans>
				<cbc:PaymentMeansCode listID="UNCL4461">30</cbc:PaymentMeansCode>
				<cbc:PaymentDueDate>
					<xsl:value-of select="concat(substring(OrderHead/Ord_DueDt,1,4),'-',substring(OrderHead/Ord_DueDt,5,2),'-',substring(OrderHead/Ord_DueDt,7,2))"/>
				</cbc:PaymentDueDate>
				<cbc:PaymentID>
					<xsl:value-of select="OrderHead/Ord_CID"/>
				</cbc:PaymentID>
				<cac:PayeeFinancialAccount>
					<xsl:choose>
						<xsl:when test="OrderHead/InvoiceCustomer_ISOCode = 'NO'">
							<cbc:ID schemeID="BBAN">
								<xsl:value-of select="OrderHead/FrmData_BGiro"/>
							</cbc:ID>
						</xsl:when>
						<xsl:otherwise>
							<cbc:ID schemeID="IBAN">
								<xsl:value-of select="OrderHead/FrmData_IBAN"/>
							</cbc:ID>
						</xsl:otherwise>
					</xsl:choose>
					<cbc:PaymentNote/>
				</cac:PayeeFinancialAccount>
			</cac:PaymentMeans>
			<cac:PaymentTerms>
				<cbc:Note>
					<xsl:value-of select="OrderHead/Txt_PayTrm"/>
				</cbc:Note>
			</cac:PaymentTerms>
	
			<cac:LegalMonetaryTotal>
				<cbc:LineExtensionAmount currencyID="{$ISOcurrency}">
					<xsl:value-of select="format-number(OrderHead/Ord_NOrdSum,'#.00', 'european')"/>
				</cbc:LineExtensionAmount>
				<cbc:TaxExclusiveAmount currencyID="{$ISOcurrency}">
					<xsl:value-of select="format-number(OrderHead/Ord_NOrdSum,'#.00', 'european')"/>
				</cbc:TaxExclusiveAmount>
				<cbc:TaxInclusiveAmount currencyID="{$ISOcurrency}">
					<xsl:value-of select="format-number(OrderHead/Ord_NOrdSum + OrderHead/Ord_VatAm,'#.00', 'european')"/>
				</cbc:TaxInclusiveAmount>
				<cbc:PayableAmount currencyID="{$ISOcurrency}">
					<xsl:value-of select="format-number(OrderHead/Ord_NOrdSum + OrderHead/Ord_VatAm,'#.00', 'european')"/>
				</cbc:PayableAmount>
			</cac:LegalMonetaryTotal>
			<xsl:for-each select="OrderLine">
				<xsl:if test="OrdLn_Descr != ''">
					<cac:InvoiceLine>
						<cbc:ID>
							<xsl:value-of select="OrdLn_LnNo"/>
						</cbc:ID>
						<cbc:Note>
							<xsl:value-of select="OrdLn_RefNo"/>
						</cbc:Note>
						<cbc:InvoicedQuantity unitCode="EA" unitCodeListID="UNECERec20">
							<xsl:value-of select="format-number(OrdLn_NoInvoAb,'#.00', 'european')"/>
						</cbc:InvoicedQuantity>
						<cbc:LineExtensionAmount currencyID="{$ISOcurrency}">
							<xsl:value-of select="OrdLn_Am"/>
						</cbc:LineExtensionAmount>
						<cbc:AccountingCost><xsl:text>Not available</xsl:text></cbc:AccountingCost>
						<xsl:if test="OrdLn_DelDt &gt; 0">
							<cac:InvoicePeriod>
								<cbc:StartDate>
									<xsl:value-of select="concat(substring(OrdLn_DelDt,1,4),'-',substring(OrdLn_DelDt,5,2),'-',substring(OrdLn_DelDt,7,2))"/>
								</cbc:StartDate>
								<cbc:EndDate>
									<xsl:value-of select="concat(substring(OrdLn_TrDt,1,4),'-',substring(OrdLn_TrDt,5,2),'-',substring(OrdLn_TrDt,7,2))"/>
								</cbc:EndDate>
							</cac:InvoicePeriod>
						</xsl:if>
						<cac:OrderLineReference>
							<cbc:LineID>
								<xsl:value-of select="$OrderNo"/><xsl:text>##</xsl:text>
								<xsl:value-of select="OrdLn_LnNo"/>
							</cbc:LineID>
						</cac:OrderLineReference>
						<cac:AllowanceCharge>
							<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
							<cbc:AllowanceChargeReason>Rabatt</cbc:AllowanceChargeReason>
							<cbc:Amount currencyID="{$ISOcurrency}">
								<xsl:value-of select="format-number(OrdLn_DstDc, '#.0000', 'european')"/>
							</cbc:Amount>
						</cac:AllowanceCharge>
						<cac:TaxTotal>
							<cbc:TaxAmount currencyID="{$ISOcurrency}">
								<xsl:value-of select="format-number(OrdLn_VatAm,'#.00', 'european')"/>
							</cbc:TaxAmount>
						</cac:TaxTotal>
						<cac:Item>
							<cbc:Description>
								<xsl:value-of select="OrdLn_Descr"/>
							</cbc:Description>
							<cbc:Name>
								<xsl:value-of select="substring(OrdLn_Descr,1,40)"/>
							</cbc:Name>
							<cac:SellersItemIdentification>
								<cbc:ID>
									<xsl:choose>
										<xsl:when test="OrdLn_ProdNo = ''">.</xsl:when>
										<xsl:when test="OrdLn_ProdNo != ''">
											<xsl:value-of select="OrdLn_ProdNo"/>
										</xsl:when>
									</xsl:choose>
								</cbc:ID>
							</cac:SellersItemIdentification>
						</cac:Item>
						<cac:Price>
							<cbc:PriceAmount currencyID="{$ISOcurrency}">
								<xsl:value-of select="format-number(OrdLn_Price, '0.0000', 'european')"/>
							</cbc:PriceAmount>
							<cbc:BaseQuantity unitCode="EA" unitCodeListID="UNECERec20">1</cbc:BaseQuantity>
						</cac:Price>
					</cac:InvoiceLine>
				</xsl:if>
			</xsl:for-each>

	
	</xsl:template>
</xsl:stylesheet>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.