juls_pro_37: XSLT String von links auffüllen

Beitrag lesen

Hi Thomas,

danke für die Empfehlung, werde mich die Tage mehr ins Thema XSLT einlesen. (ist noch komplettes Neuland...)

Leider bring ich das nicht ganz zusammen, hier mein XML:

<?xml version="1.0" encoding="UTF-8"?>
<SALESORDER>
  <Interchange>
    <InterchangeReference></InterchangeReference>
    <Test></Test>     
     <CreationDateTime></CreationDateTime>	 
     <MessageReference></MessageReference>
     <Recipient></Recipient>
     <Sender></Sender>
    <HeaderInformation>
      <DeliveryDate></DeliveryDate>      
      <CustomerOrderReference></CustomerOrderReference>      
      <HeaderText>
       <Qualifier></Qualifier>
       <Text></Text>
      </HeaderText>
      <HeaderText>
       <Qualifier></Qualifier>
       <Text></Text>
      </HeaderText>
     <DeliveryAddressInformation>
      <GLN></GLN>      
     </DeliveryAddressInformation>
     <BuyerAddressInformation>
      <GLN></GLN>      
     </BuyerAddressInformation>						   
     <InvoiceAddressInformation>
      <GLN></GLN>
     </InvoiceAddressInformation>
     <LineItem>
      <Line>1</Line>
      <GTIN>1256910</GTIN>     
      <RequestedQuantity></RequestedQuantity>
      <BuyerArticleNumber></BuyerArticleNumber>
      <LineText>
       <Qualifier></Qualifier>
       <Text></Text>
      </LineText>
      <LineText>
       <Qualifier></Qualifier>
       <Text></Text>
      </LineText>
      <Unit></Unit>
     </LineItem>
     <LineItem>
      <Line>2</Line>
      <GTIN>611150508</GTIN>      
      <RequestedQuantity></RequestedQuantity>
      <BuyerArticleNumber></BuyerArticleNumber>
      <LineText>
       <Qualifier></Qualifier>
       <Text></Text>
      </LineText>
      <LineText>
       <Qualifier></Qualifier>
       <Text></Text>
      </LineText>
      <Unit></Unit>
     </LineItem>
    </HeaderInformation>
  </Interchange>
</SALESORDER>

Anbei mein XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes"/>
	
    <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template> 
	
	<xsl:template match="LineItem/GTIN">
    <xsl:copy>
		<xsl:variable name="LineItem" select="'GTIN'"/>
		<xsl:value-of select="concat(substring('00000000000000', 1, 14 - string-length($LineItem)), $LineItem)"/>
	</xsl:copy>
  </xsl:template>
  
</xsl:stylesheet>

lg Julian