locked
XSLT 1.0 output a value if condition RRS feed

  • Question

  • User1310825703 posted

    Hi, 

    how can i set up my xslt correctly? I hope you can help me.

    If there are differents at "PackingslipId"-"LineItem"-"Lines" i don´t like to have "PackingslipId" and "DeliveryDate" on "HeaderInformation".

    If the "PackingslipId" is always the same at "LineItem"-"Lines" than on "HeaderInformation" the output "PackingslipId" and "DeliveryDate" is ok.

    Please note: (I don´t no if important; it also can be, that there is just one Article ("LineItem"-"Lines" - with "OrderLineNum" 1) - in this case, the "PackingslipId" is the same of "Lines" and "HeaderInformation" so "PackingslipId" and "DeliveryDate" should be also on "HeaderInformation" and "LineItem"

    My XML:

    <?xml version="1.0" encoding="utf-8"?>
    <SALESINVOICE>
    	<Interchange>
    		<Recipient></Recipient>
    		<Sender></Sender>
    		<CreationDate></CreationDate>
    		<Test></Test>
    		<Interchange_Control_Number></Interchange_Control_Number>
    		<HeaderInformation>
    			<OrigInvoiceNumber></OrigInvoiceNumber>
    			<InvoiceType></InvoiceType>
    			<InvoiceDate></InvoiceDate>
    			<InvoiceNumber></InvoiceNumber>
    			<CustomerOrderReference></CustomerOrderReference>
    			<SalesOrderReference></SalesOrderReference>
    			<SalesOrderDate></SalesOrderDate>
    			<PackingslipId>AV1800089</PackingslipId>
    			<DeliveryDate>2018-11-14</DeliveryDate>
    			<Currency></Currency>
    			<TaxExempt></TaxExempt>
    			<Contact>
    				<Contact></Contact>
    			</Contact>
    			<TermsOfPayment>
    				<PaymTermDescription></PaymTermDescription>
    				<DueDate></DueDate>
    			</TermsOfPayment>
    			<CashDiscountConditions />
    			<WeightAndVolume>
    				<NetWeight></NetWeight>
    				<UnifOfWeight></UnifOfWeight>
    			</WeightAndVolume>
    			<SupplierAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<CoRegNum></CoRegNum>
    				<VATNum></VATNum>
    			</SupplierAddressInformation>
    			<BuyerAddressInformation>
    				<Name></Name>
    				<Country></Country>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</BuyerAddressInformation>
    			<InvoiceAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</InvoiceAddressInformation>
    			<DeliveryAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<State></State>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</DeliveryAddressInformation>
    			<TransportDetails>
    				<DeliveryTerms></DeliveryTerms>
    			</TransportDetails>
    			<LineItem>
    				<Lines>
    					<OrderLineNum>1</OrderLineNum>
    					<PackingslipId>AV1800089</PackingslipId>
    					<DeliveryDate>2018-11-14</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>2</OrderLineNum>
    					<PackingslipId>AV1800089</PackingslipId>
    					<DeliveryDate>2018-11-14</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>3</OrderLineNum>
    					<PackingslipId>AV1800090</PackingslipId>
    					<DeliveryDate>2018-11-15</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    			</LineItem>
    			<Totals>
    				<InvoiceTotal></InvoiceTotal>
    				<NetAmount></NetAmount>
    				<VATAmount></VATAmount>
    				<DiscountAmount></DiscountAmount>
    				<AllowanceOrChargeAmount></AllowanceOrChargeAmount>
    				<DueDate></DueDate>
    				<VAT>
    					<VATS>
    						<Percentage></Percentage>
    						<Type></Type>
    						<BaseAmount></BaseAmount>
    						<VATAmount></VATAmount>
    					</VATS>
    				</VAT>
    			</Totals>
    		</HeaderInformation>
    	</Interchange>
    </SALESINVOICE>

    So in my case above, the output should be no "PackingsslipId" and "DeliveryDate" on "HeaderInformation":

    <?xml version="1.0" encoding="utf-8"?>
    <SALESINVOICE>
    	<Interchange>
    		<Recipient></Recipient>
    		<Sender></Sender>
    		<CreationDate></CreationDate>
    		<Test></Test>
    		<Interchange_Control_Number></Interchange_Control_Number>
    		<HeaderInformation>
    			<OrigInvoiceNumber></OrigInvoiceNumber>
    			<InvoiceType></InvoiceType>
    			<InvoiceDate></InvoiceDate>
    			<InvoiceNumber></InvoiceNumber>
    			<CustomerOrderReference></CustomerOrderReference>
    			<SalesOrderReference></SalesOrderReference>
    			<SalesOrderDate></SalesOrderDate>			
    			<Currency></Currency>
    			<TaxExempt></TaxExempt>
    			<Contact>
    				<Contact></Contact>
    			</Contact>
    			<TermsOfPayment>
    				<PaymTermDescription></PaymTermDescription>
    				<DueDate></DueDate>
    			</TermsOfPayment>
    			<CashDiscountConditions />
    			<WeightAndVolume>
    				<NetWeight></NetWeight>
    				<UnifOfWeight></UnifOfWeight>
    			</WeightAndVolume>
    			<SupplierAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<CoRegNum></CoRegNum>
    				<VATNum></VATNum>
    			</SupplierAddressInformation>
    			<BuyerAddressInformation>
    				<Name></Name>
    				<Country></Country>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</BuyerAddressInformation>
    			<InvoiceAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</InvoiceAddressInformation>
    			<DeliveryAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<State></State>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</DeliveryAddressInformation>
    			<TransportDetails>
    				<DeliveryTerms></DeliveryTerms>
    			</TransportDetails>
    			<LineItem>
    				<Lines>
    					<OrderLineNum>1</OrderLineNum>
    					<PackingslipId>AV1800089</PackingslipId>
    					<DeliveryDate>2018-11-14</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>2</OrderLineNum>
    					<PackingslipId>AV1800089</PackingslipId>
    					<DeliveryDate>2018-11-14</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>3</OrderLineNum>
    					<PackingslipId>AV1800090</PackingslipId>
    					<DeliveryDate>2018-11-15</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    			</LineItem>
    			<Totals>
    				<InvoiceTotal></InvoiceTotal>
    				<NetAmount></NetAmount>
    				<VATAmount></VATAmount>
    				<DiscountAmount></DiscountAmount>
    				<AllowanceOrChargeAmount></AllowanceOrChargeAmount>
    				<DueDate></DueDate>
    				<VAT>
    					<VATS>
    						<Percentage></Percentage>
    						<Type></Type>
    						<BaseAmount></BaseAmount>
    						<VATAmount></VATAmount>
    					</VATS>
    				</VAT>
    			</Totals>
    		</HeaderInformation>
    	</Interchange>
    </SALESINVOICE>

    Do you need more examples?

    Thanks, Julian

    Friday, November 16, 2018 6:48 AM

All replies

  • User-893317190 posted

    Hi juls_pro_37,

    You could use the template below. Expression  lines[not(PackingslipId = preceding-sibling::lines/PackingslipId)] will get the lines whose PackingslipId  is not the same as other,

    if the count is one , it means they are all the same.

    <xsl:template match="/salesinvoices/lineItem">
        <xsl:choose>
          <xsl:when test="
          count(lines[not(PackingslipId = preceding-sibling::lines/PackingslipId)]) = 1
        ">
    
            <xsl:copy-of select="//header/PackingslipId"/>
            <xsl:copy-of select="//header/DeliveryDate"/>
       
            </xsl:when>
              <xsl:otherwise>
                <empty>no data</empty>  <!--it will be clear that you they are not the same ,you could remove it in your xslt-->
              </xsl:otherwise>
            </xsl:choose>
      </xsl:template>

    Below is my test xml

    <?xml version="1.0" encoding="utf-8" ?>
    <salesinvoices>
    
      <header>
       
      <PackingslipId>AV1800089</PackingslipId>
    			<DeliveryDate>2018-11-14</DeliveryDate>
        
      
      </header>
      
    <lineItem>
          
          <lines>
            <PackingslipId>AV1800089</PackingslipId>
          </lines>    
          
          <lines>
            <PackingslipId>AV1800089different</PackingslipId>
          </lines>    
          
          <lines>
            <PackingslipId>AV1800089</PackingslipId>
          </lines>    
      
      
        </lineItem>
    
    </salesinvoices>

    The result.  

    <salesinvoices>
       <header>
          <empty>no data</empty>
       </header>
       <lineItem>
          
          <lines>
            <PackingslipId>AV1800089</PackingslipId>
          </lines>    
          
          <lines>
            <PackingslipId>AV1800089different</PackingslipId>
          </lines>    
          
          <lines>
            <PackingslipId>AV1800089</PackingslipId>
          </lines>    
      
      
        </lineItem>
    </salesinvoices>

    You could also refer to the link below

    https://stackoverflow.com/questions/3188749/xslt-how-to-check-if-certain-nodes-are-all-equal-in-one-parent

    Best regards,

    Ackerly Xu

    Monday, November 19, 2018 3:26 AM
  • User1310825703 posted

    Hi Ackerly Xu,

    thanks for your input, but i think your xslt doesn´t work correctly. :( (Theres no correct output)

    I show you, can you help me please?

    My xslt (with your code - i changed header to HeaderInformation at copy)

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" standalone="yes" indent="yes"/>
      <xsl:strip-space elements="*" />
      <xsl:key name="header_text" match="HeaderText" use="Text"/>
      <xsl:key name="line_text" match="LineText" use="concat(../OrderLineNum, '|', Text)"/>
    
      <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
      </xsl:template>
    
      <!-- no duplilcate on HeaderText and LineText -->
      <xsl:template match="HeaderText[generate-id() != generate-id(key('header_text', Text)[1])]" />
      <xsl:template match="LineText[generate-id() != generate-id(key('line_text', concat(../OrderLineNum, '|', Text))[1])]" />
      
      <!-- delete PackingslipId on HeaderInformation, if different at Line -->
      <xsl:template match="/salesinvoices/lineItem">
        <xsl:choose>
          <xsl:when test="
          count(lines[not(PackingslipId = preceding-sibling::lines/PackingslipId)]) = 1">
    
            <xsl:copy-of select="//HeaderInformation/PackingslipId"/>
            <xsl:copy-of select="//HeaderInformation/DeliveryDate"/>
       
            </xsl:when>
              <xsl:otherwise>            
              </xsl:otherwise>
            </xsl:choose>
      </xsl:template>
    
    <!-- delete empty nodes -->
     <xsl:template match="node()|@*">
         <xsl:copy>
           <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
     </xsl:template>
    
     <xsl:template match="*[not(@*|*|comment()|processing-instruction()) and normalize-space()='']"/>
     
    </xsl:stylesheet>

    My xml:

    <?xml version="1.0" encoding="utf-8"?>
    <SALESINVOICE>
    	<Interchange>
    		<Recipient></Recipient>
    		<Sender></Sender>
    		<CreationDate>2018-11-19:07:06:20</CreationDate>
    		<Test>No</Test>
    		<Interchange_Control_Number></Interchange_Control_Number>
    		<HeaderInformation>
    			<OrigInvoiceNumber>1</OrigInvoiceNumber>
    			<InvoiceType>INVOIC</InvoiceType>
    			<InvoiceDate>2018-11-19</InvoiceDate>
    			<InvoiceNumber>FV1800087</InvoiceNumber>
    			<CustomerOrderReference></CustomerOrderReference>
    			<SalesOrderReference></SalesOrderReference>
    			<SalesOrderDate>2018-11-15T07:22:01</SalesOrderDate>
    			<PackingslipId>AV1800097</PackingslipId>
    			<DeliveryDate>2018-11-19</DeliveryDate>
    			<Currency>EUR</Currency>
    			<TaxExempt></TaxExempt>
    			<Contact />
    			<TermsOfPayment>
    				<PaymTermDescription></PaymTermDescription>
    				<DueDate></DueDate>
    			</TermsOfPayment>
    			<CashDiscountConditions />
    			<WeightAndVolume>
    				<NetWeight></NetWeight>
    				<UnifOfWeight></UnifOfWeight>
    			</WeightAndVolume>
    			<SupplierAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<CoRegNum></CoRegNum>
    				<VATNum></VATNum>
    			</SupplierAddressInformation>
    			<BuyerAddressInformation>
    				<Name></Name>
    				<Country></Country>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</BuyerAddressInformation>
    			<InvoiceAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</InvoiceAddressInformation>
    			<DeliveryAddressInformation>
    				<GLN></GLN>
    				<Name></Name>
    				<Street></Street>
    				<ZipCode></ZipCode>
    				<City></City>
    				<Country></Country>
    				<State></State>
    				<VATNum></VATNum>
    				<InternalNumber></InternalNumber>
    			</DeliveryAddressInformation>
    			<TransportDetails>
    				<DeliveryTerms></DeliveryTerms>
    			</TransportDetails>
    			<LineItem>
    				<Lines>
    					<OrderLineNum>1</OrderLineNum>
    					<PackingslipId>AV1800097</PackingslipId>
    					<DeliveryDate>2018-11-19</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>2</OrderLineNum>
    					<PackingslipId>AV1800098</PackingslipId>
    					<DeliveryDate>2018-11-19</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>3</OrderLineNum>
    					<PackingslipId>AV1800099</PackingslipId>
    					<DeliveryDate>2018-11-19</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    				<Lines>
    					<OrderLineNum>4</OrderLineNum>
    					<PackingslipId>AV1800099</PackingslipId>
    					<DeliveryDate>2018-11-19</DeliveryDate>
    					<GTIN></GTIN>
    					<GTINDescription></GTINDescription>
    					<SupplierArticleNumber></SupplierArticleNumber>
    					<Quantity></Quantity>
    					<PriceUnit></PriceUnit>
    					<FixedPrice></FixedPrice>
    					<SalesPrice></SalesPrice>
    					<DiscAmount></DiscAmount>
    					<DiscPercent></DiscPercent>
    					<SalesLinePercent1></SalesLinePercent1>
    					<SalesLinePercent2></SalesLinePercent2>
    					<MultiLnDisc></MultiLnDisc>
    					<MultiLnPercent></MultiLnPercent>
    					<LineAmount></LineAmount>
    					<SumLineDisc></SumLineDisc>
    					<DeliveredQuantity></DeliveredQuantity>
    					<VatBaseAmount></VatBaseAmount>
    					<VatPercentage></VatPercentage>
    					<Measure_Unit></Measure_Unit>
    				</Lines>
    			</LineItem>
    			<Totals>
    				<InvoiceTotal></InvoiceTotal>
    				<NetAmount></NetAmount>
    				<VATAmount></VATAmount>
    				<DiscountAmount></DiscountAmount>
    				<AllowanceOrChargeAmount></AllowanceOrChargeAmount>
    				<DueDate></DueDate>
    				<VAT>
    					<VATS>
    						<Percentage></Percentage>
    						<Type></Type>
    						<BaseAmount></BaseAmount>
    						<VATAmount></VATAmount>
    					</VATS>
    				</VAT>
    			</Totals>
    		</HeaderInformation>
    	</Interchange>
    </SALESINVOICE>

    Thanks, best regards

    Julian

    Monday, November 19, 2018 7:21 AM
  • User1310825703 posted

    thats it: 

    <xsl:template match="HeaderInformation[PackingslipId != LineItem/Lines/PackingslipId]/*[self::PackingslipId or self::DeliveryDate]" />
    thx for your help!
    best regards
    Julian
    Monday, November 19, 2018 1:35 PM
  • User-893317190 posted

    Hi juls_pro_37,

    Do you mean you have successfully solved your problems through this way?

    Tuesday, November 20, 2018 2:01 AM
  • User1310825703 posted

    yes, thats the solution.

    Tuesday, November 20, 2018 8:49 AM