我正在使用的XSLT是-
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:Extensions="Extensions"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">
<xsl:param name="lookupDataObject" />
<xsl:template match="/">
<InboundASNBridge xsi:noNamespaceSchemaLocation="file://c:\XML%20Schemas\2004R1\2004R1%20WM%20Schemas\InboundASNBridge_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:for-each select="*/IDOC/E1EDT20">
<!-- only write record if details exist-->
<InboundASN>
<ShipmentNbr>
<xsl:value-of select="TKNUM"/>
</ShipmentNbr>
<!-- Added by Ekta for crossref -->
<!--<xsl:variable name="varToLocation">
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(E1EDL20/E1EDL24/WERKS),1,'ToLocation')"/>
</xsl:variable>
<xsl:if test="$varToLocation != 'NA' ">
<ToLocation>
<xsl:value-of select="$varToLocation"/>
</ToLocation>
</xsl:if>-->
<!-- <ToLocation>
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(E1EDL20/E1EDL24/WERKS),1,'ToLocation')"/>
</ToLocation> -->
<AsnType/>
<BatchCtlNbr>
<!-- Get the rightmost 10 characters -->
<xsl:variable name="DOCNUM_NODE" select="../EDI_DC40/DOCNUM"/>
<xsl:variable name="DOCNUM_LEN" select="string-length($DOCNUM_NODE)"/>
<xsl:if test="$DOCNUM_LEN > 10">
<xsl:value-of select="substring($DOCNUM_NODE,$DOCNUM_LEN -9,10)"/>
</xsl:if>
<xsl:if test="$DOCNUM_LEN <= 10">
<xsl:value-of select="$DOCNUM_NODE"/>
</xsl:if>
</BatchCtlNbr>
<CasesShipped>0</CasesShipped>
<ASNHeaderFields>
<ManifestNbr>
<xsl:if test="../E1EDT20/EXTI1">
<xsl:value-of select="../E1EDT20/EXTI1"/>
</xsl:if>
</ManifestNbr>
<BillOfLading></BillOfLading>
<PONbr></PONbr>
<ShipVia></ShipVia>
<TrailerNumber></TrailerNumber>
<TelephoneNumber></TelephoneNumber>
<WhseTransferFlag></WhseTransferFlag>
<QcHoldUponReceipt></QcHoldUponReceipt>
<ShippedDate>
<xsl:if test="../IDOC/E1EDT20/E1EDT10[QUALF='499' and VSTZW_BEZ='Due DC Date']/NTANF != '00000000'">
<xsl:value-of select="../IDOC/E1EDT20/E1EDT10[QUALF='499' and VSTZW_BEZ='Due DC Date']/NTANF"/>
</xsl:if>
</ShippedDate>
<TotalWeight>0</TotalWeight>
<CountryOrigin><xsl:value-of select="(E1EDL20/E1ADRM1[PARTNER_Q='LF']/COUNTRY1)"/></CountryOrigin>
<!--<xsl:variable name="varShipmentType">
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','SHIPMENT_TYPE',true(),string(../E1EDT20/SHTYP),1,'ShipmentType')"/>
</xsl:variable>
<ShipmentType>
<xsl:value-of select="$varShipmentType"/>
</ShipmentType>-->
<Volume>0</Volume>
<StatusCode>10</StatusCode>
<FirmApptIndicator>40</FirmApptIndicator>
<ScheduledAppt></ScheduledAppt>
<ASNOriginalType>P</ASNOriginalType>
<ASNDetailType></ASNDetailType>
</ASNHeaderFields>
<ListOfASNDetails>
<xsl:for-each select="E1EDL20/E1EDL24">
<xsl:variable name="current-pos" select="position()"/>
<ASNDetail>
<SKUDefinition>
<!-- Added by Ekta for crossref -->
<!--<xsl:variable name="varCompany">
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(WERKS),2,'Company')"/>
</xsl:variable>
<xsl:if test="$varCompany != 'NA' ">
<Company>
<xsl:value-of select="$varCompany"/>
--><!-- <xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(WERKS),2,'Company')"/> --><!--
</Company>
</xsl:if>-->
<!-- <Company>
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(WERKS),2,'Company')"/>
</Company> -->
<!-- Added by Ekta for crossref -->
<xsl:variable name="varDivision">
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(WERKS),3,'Division')"/>
</xsl:variable>
<xsl:if test="$varDivision != 'NA' ">
<Division>
<xsl:value-of select="$varDivision"/>
<!-- <xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(WERKS),3,'Division')"/> -->
</Division>
</xsl:if>
<!-- <Division>
<xsl:value-of select="java:onCall($lookupDataObject,'SAP','PlantLoc_to_WhseComDiv',true(),string(WERKS),3,'Division')"/>
</Division> -->
<xsl:variable name="varMATNR">
<xsl:value-of select="MATNR"/>
</xsl:variable>
<Season/>
<SeasonYear/>
<Style/>
<StyleSuffix/>
<Color/>
<SizeDesc><xsl:value-of select="substring($varMATNR,1,12)"/></SizeDesc>
<StockPool><xsl:value-of select="(WERKS)"/></StockPool>
</SKUDefinition>
<SequenceNbr>
<!-- <xsl:value-of select="java:namedCounter($lookupDataObject,0)"/> --> <!-- Added by Ekta -->
<xsl:value-of select="$current-pos" /> <!-- Added By Ekta -->
</SequenceNbr>
<UnitsShipped> <!-- added by ekta -->
<xsl:choose>
<xsl:when test="number(LFIMG)">
<xsl:value-of select="LFIMG"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</UnitsShipped>
<SubSKUFields>
<BatchNumber/>
<InventoryType>F</InventoryType>
</SubSKUFields>
<PONbr>
<!-- Get the rightmost 2 characters -->
<xsl:variable name="varRight">
<xsl:variable name="varWERKS" select="WERKS"/>
<xsl:variable name="varLEN" select="string-length($varWERKS)"/>
<xsl:if test="$varLEN > 1">
<xsl:value-of select="substring($varWERKS,$varLEN -1,$varLEN)"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="varRight1">
<xsl:variable name="varBELNR" select="E1EDL43/BELNR"/>
<xsl:variable name="varLEN1" select="string-length($varBELNR)"/>
<xsl:if test="$varLEN1 > 1">
<xsl:value-of select="substring($varBELNR,$varLEN1 -7,$varLEN1)"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="varRight2">
<xsl:variable name="varPOSNR" select="E1EDL43/POSNR"/>
<xsl:variable name="varLEN2" select="string-length($varPOSNR)"/>
<xsl:if test="$varLEN2 > 1">
<xsl:value-of select="substring($varPOSNR,$varLEN2 -4,$varLEN2)"/>
</xsl:if>
</xsl:variable>
<xsl:value-of select="concat(substring($varRight,1,2),substring($varRight1,1,8),substring($varRight2,1,5))"/>
</PONbr>
<ASNDetailFields>
<QcHoldUponReceipt>N</QcHoldUponReceipt>
<ActionCode>02</ActionCode>
<ProcessImmdNeeds>Y</ProcessImmdNeeds>
<POLineNbr>0</POLineNbr>
<VendorName><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/NAME1)"/></VendorName>
<VendorItemNumber>
<xsl:value-of select="substring(../E1ADRM1[PARTNER_Q='LF']/PARTNER_ID,1,10)"/>
</VendorItemNumber>
<VendorAddress1><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/STREET1)"/></VendorAddress1>
<VendorAddress2><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/STREET2)"/></VendorAddress2>
<VendorAddress3><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/STREET2)"/></VendorAddress3>
<VendorCity><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/CITY1)"/></VendorCity>
<VendorCntry><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/COUNTRY1)"/></VendorCntry>
<VendorPhone><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/TELEPHONE1)"/></VendorPhone>
<VendorFax><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/TELEFAX)"/></VendorFax>
<VendorEmail><xsl:value-of select="(../E1ADRM1[PARTNER_Q='LF']/E_MAIL)"/></VendorEmail>
</ASNDetailFields>
</ASNDetail>
</xsl:for-each>
</ListOfASNDetails>
</InboundASN>
</xsl:for-each>
</InboundASNBridge>
</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2003 Copyright Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
</metaInformation>
-->
无论我做什么,我都无法使XSLT通过XSLT传递'MATT'的值作为输出。
我要传递的示例XML是-
<?xml
version="1.0"?><SHPMNT05><IDOC
BEGIN="1"><EDI_DC40
SEGMENT="1"><TABNAM><![CDATA[EDI_DC40]]></TABNAM><MANDT>500</MANDT><DOCNUM>0000000581904575</DOCNUM><DOCREL>740</DOCREL><STATUS>03</STATUS><DIRECT>1</DIRECT><OUTMOD>4</OUTMOD><IDOCTYP>SHPMNT05</IDOCTYP><MESTYP>SHPMNT</MESTYP><SNDPOR>SAPPR3</SNDPOR><SNDPRT>LS</SNDPRT><SNDPRN>PR3CLNT500</SNDPRN><RCVPOR>EISSHPMNT</RCVPOR><RCVPRT>LS</RCVPRT><RCVPFC>LS</RCVPFC><RCVPRN>WESTWAY</RCVPRN><CREDAT>20180614</CREDAT><CRETIM>114718</CRETIM><SERIAL>20180614114714</SERIAL></EDI_DC40><E1EDT20
SEGMENT="1"><TKNUM>0002210124</TKNUM><SHTYP>Z010</SHTYP><ABFER>2</ABFER><ABWST>1</ABWST><BFART>1</BFART><LAUFK>4</LAUFK><ROUTE>GBSTN</ROUTE><EXTI1>ECMU4556130</EXTI1><EXTI2>YAT0005864732</EXTI2><STTRG>1</STTRG><DTMEG>KGM</DTMEG><DTMEV>DMQ</DTMEV><DISTZ>0.000</DISTZ><FAHZT>0.00</FAHZT><GESZT>0.00</GESZT><GESZTD>0</GESZTD><FAHZTD>0</FAHZTD><GESZTDA>0</GESZTDA><FAHZTDA>0</FAHZTDA><WARZTD>
0</WARZTD><WARZTDA>
0</WARZTDA><E1EDT22
SEGMENT="1"><SHTYP_BEZ>01)Westway
Shipment</SHTYP_BEZ><BFART_BEZ>Load</BFART_BEZ><LAUFK_BEZ>Direct
leg</LAUFK_BEZ><ROUTE_BEZ>Southampton -
GF</ROUTE_BEZ><STTRG_BEZ>Planning
completed</STTRG_BEZ></E1EDT22><E1EDT18
SEGMENT="1"><QUALF>ORI</QUALF></E1EDT18><E1ADRM4
SEGMENT="1"><PARTNER_Q>OTP</PARTNER_Q><PARTNER_ID>0001</PARTNER_ID><LANGUAGE>EN</LANGUAGE><COUNTRY1>GB</COUNTRY1><E1ADRE4
SEGMENT="1"><EXTEND_Q>305</EXTEND_Q><EXTEND_D>0001</EXTEND_D></E1ADRE4></E1ADRM4><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Loading</VSTZW_BEZ><NTANF>20180511</NTANF><NTANZ>010000</NTANZ><NTEND>20180511</NTEND><NTENZ>010000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>WSHDR0001</EVENT><EVENT_ALI>WS LOADING
FREE</EVENT_ALI></E1EDT10><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Depart Port of
Loadi</VSTZW_BEZ><NTANF>20180523</NTANF><NTANZ>010000</NTANZ><NTEND>20180523</NTEND><NTENZ>010000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>WSHDR0005</EVENT><EVENT_ALI>WS ETD
FREE</EVENT_ALI></E1EDT10><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Arrival Port of
Dest</VSTZW_BEZ><NTANF>20180617</NTANF><NTANZ>010000</NTANZ><NTEND>20180617</NTEND><NTENZ>010000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>WSHDR0006</EVENT><EVENT_ALI>WS ETA
FREE</EVENT_ALI></E1EDT10><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Due DC
Date</VSTZW_BEZ><NTANF>MATT</NTANF><NTANZ>010000</NTANZ><NTEND>20180622</NTEND><NTENZ>010000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>WSHDR0007</EVENT><EVENT_ALI>WS DUE DC
FREE</EVENT_ALI></E1EDT10><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Import
date</VSTZW_BEZ><NTANF>00000000</NTANF><NTANZ>000000</NTANZ><NTEND>00000000</NTEND><NTENZ>000000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>ZWSHDR0008</EVENT><EVENT_ALI>WS IMP DT
FREE</EVENT_ALI></E1EDT10><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Free
date</VSTZW_BEZ><NTANF>00000000</NTANF><NTANZ>000000</NTANZ><NTEND>00000000</NTEND><NTENZ>000000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>ZWSHDR0009</EVENT><EVENT_ALI>WS FRE DT
FREE</EVENT_ALI></E1EDT10><E1EDT10
SEGMENT="1"><QUALF>499</QUALF><VSTZW_BEZ>Release
date</VSTZW_BEZ><NTANF>00000000</NTANF><NTANZ>000000</NTANZ><NTEND>00000000</NTEND><NTENZ>000000</NTENZ><ISDD>00000000</ISDD><ISDZ>000000</ISDZ><IEDD>00000000</IEDD><IEDZ>000000</IEDZ><EVENT>ZWSHDR0010</EVENT><EVENT_ALI>WS REL DT
FREE</EVENT_ALI></E1EDT10><E1EDL35
SEGMENT="1"><STAWN>6404199000</STAWN><EXART>10</EXART><HERKL>CN</HERKL><HERKR>SO</HERKR><GRWRT>696.62</GRWRT><E1EDL36
SEGMENT="1"><EXART_BEZ>Standard Sale or
Purchase</EXART_BEZ><HERKL_BEZ>China</HERKL_BEZ></E1EDL36></E1EDL35><E1EDL43
SEGMENT="1"><QUALF>V</QUALF><BELNR>0061025409</BELNR><POSNR>000130</POSNR></E1EDL43><E1EDL24
SEGMENT="1"><POSNR>000080</POSNR><MATNR>261214585040</MATNR><ARKTX>Sillian Bella Navy, E,
4</ARKTX><MATKL>MC018</MATKL><WERKS>DC01</WERKS><LGORT>0001</LGORT><CHARG>00004</CHARG><LFIMG>64.000</LFIMG><VRKME>PCE</VRKME><LGMNG>64.000</LGMNG><MEINS>PCE</MEINS><NTGEW>18.752</NTGEW><BRGEW>18.752</BRGEW><GEWEI>KGM</GEWEI><VOLUM>304.640</VOLUM><VOLEH>DMQ</VOLEH><LADGR>Z001</LADGR><TRAGR>0001</TRAGR><GRKOR>000</GRKOR><EAN11>5050406676793</EAN11><POSEX>000004</POSEX><VFDAT>20180511</VFDAT><EXPIRY_DATE_EXT>0</EXPIRY_DATE_EXT><VGBEL>0061025409</VGBEL><VGPOS>000120</VGPOS><ORMNG>
64.000</ORMNG><EXPIRY_DATE_EXT_B>0</EXPIRY_DATE_EXT_B><E1EDL25
SEGMENT="1"><LGORT_BEZ>Putaway</LGORT_BEZ><LADGR_BEZ>MHE</LADGR_BEZ><TRAGR_BEZ>On
pallets</TRAGR_BEZ></E1EDL25><E1EDL26
SEGMENT="1"><PSTYV>ELN</PSTYV><MATKL>MC018</MATKL><UMVKZ>1</UMVKZ><UMVKN>1</UMVKN><UEBTK>X</UEBTK><UEBTO>0.0</UEBTO><UNTTO>5.0</UNTTO><MAGRV>BOX</MAGRV><E1EDL27
SEGMENT="1"><PSTYV_BEZ>Inbound
Delivery</PSTYV_BEZ><MATKL_BEZ>W Casual Clks
Shoes</MATKL_BEZ><WERKS_BEZ>Clarks
Retail</WERKS_BEZ></E1EDL27></E1EDL26><E1EDL35
SEGMENT="1"><STAWN>6404199000</STAWN><EXART>10</EXART><HERKL>CN</HERKL><HERKR>SO</HERKR><GRWRT>696.62</GRWRT><E1EDL36
SEGMENT="1"><EXART_BEZ>Standard Sale or
Purchase</EXART_BEZ><HERKL_BEZ>China</HERKL_BEZ></E1EDL36></E1EDL35><E1EDL43
SEGMENT="1"><QUALF>V</QUALF><BELNR>0061025409</BELNR><POSNR>000120</POSNR></E1EDL43></E1EDL24><E1EDL24
SEGMENT="1"><POSNR>000090</POSNR><MATNR>261214585035</MATNR><ARKTX>Sillian Bella Navy, E,
3+</ARKTX><MATKL>MC018</MATKL><WERKS>DC01</WERKS><LGORT>0001</LGORT><CHARG>00001</CHARG><LFIMG>16.000</LFIMG><VRKME>PCE</VRKME><LGMNG>16.000</LGMNG><MEINS>PCE</MEINS><NTGEW>4.576</NTGEW><BRGEW>4.576</BRGEW><GEWEI>KGM</GEWEI><VOLUM>76.160</VOLUM><VOLEH>DMQ</VOLEH><LADGR>Z001</LADGR><TRAGR>0001</TRAGR><GRKOR>000</GRKOR><EAN11>5050406676786</EAN11><POSEX>000001</POSEX><VFDAT>20180511</VFDAT><EXPIRY_DATE_EXT>0</EXPIRY_DATE_EXT><VGBEL>0061025409</VGBEL><VGPOS>000110</VGPOS><ORMNG>
16.000</ORMNG><EXPIRY_DATE_EXT_B>0</EXPIRY_DATE_EXT_B><E1EDL25
SEGMENT="1"><LGORT_BEZ>Putaway</LGORT_BEZ><LADGR_BEZ>MHE</LADGR_BEZ><TRAGR_BEZ>On
pallets</TRAGR_BEZ></E1EDL25><E1EDL26
SEGMENT="1"><PSTYV>ELN</PSTYV><MATKL>MC018</MATKL><UMVKZ>1</UMVKZ><UMVKN>1</UMVKN><UEBTK>X</UEBTK><UEBTO>0.0</UEBTO><UNTTO>5.0</UNTTO><MAGRV>BOX</MAGRV><E1EDL27
SEGMENT="1"><PSTYV_BEZ>Inbound
Delivery</PSTYV_BEZ><MATKL_BEZ>W Casual Clks
Shoes</MATKL_BEZ><WERKS_BEZ>Clarks
Retail</WERKS_BEZ></E1EDL27></E1EDL26><E1EDL35
SEGMENT="1"><STAWN>6404199000</STAWN><EXART>10</EXART><HERKL>CN</HERKL><HERKR>SO</HERKR><GRWRT>174.15</GRWRT><E1EDL36
SEGMENT="1"><EXART_BEZ>Standard Sale or
Purchase</EXART_BEZ><HERKL_BEZ>China</HERKL_BEZ></E1EDL36></E1EDL35><E1EDL43
SEGMENT="1"><QUALF>V</QUALF><BELNR>0061025409</BELNR><POSNR>000110</POSNR></E1EDL43></E1EDL24><E1EDL24
SEGMENT="1"><POSNR>000100</POSNR><MATNR>261214584090</MATNR><ARKTX>Sillian Bella Navy, D,
9</ARKTX><MATKL>MC018</MATKL><WERKS>DC01</WERKS><LGORT>0001</LGORT><CHARG>00003</CHARG><LFIMG>36.000</LFIMG><VRKME>PCE</VRKME><LGMNG>36.000</LGMNG><MEINS>PCE</MEINS><NTGEW>13.356</NTGEW><BRGEW>13.356</BRGEW><GEWEI>KGM</GEWEI><VOLUM>253.440</VOLUM><VOLEH>DMQ</VOLEH><LADGR>Z001</LADGR><TRAGR>0001</TRAGR><GRKOR>000</GRKOR><EAN11>5050406762489</EAN11><POSEX>000003</POSEX><VFDAT>20180511</VFDAT><EXPIRY_DATE_EXT>0</EXPIRY_DATE_EXT><VGBEL>0061025409</VGBEL><VGPOS>000100</VGPOS><ORMNG>
36.000</ORMNG><EXPIRY_DATE_EXT_B>0</EXPIRY_DATE_EXT_B><E1EDL25
SEGMENT="1"><LGORT_BEZ>Putaway</LGORT_BEZ><LADGR_BEZ>MHE</LADGR_BEZ><TRAGR_BEZ>On
pallets</TRAGR_BEZ></E1EDL25><E1EDL26
SEGMENT="1"><PSTYV>ELN</PSTYV><MATKL>MC018</MATKL><UMVKZ>1</UMVKZ><UMVKN>1</UMVKN><UEBTK>X</UEBTK><UEBTO>0.0</UEBTO><UNTTO>5.0</UNTTO><MAGRV>BOX</MAGRV><E1EDL27
SEGMENT="1"><PSTYV_BEZ>Inbound
Delivery</PSTYV_BEZ><MATKL_BEZ>W Casual Clks
Shoes</MATKL_BEZ><WERKS_BEZ>Clarks
Retail</WERKS_BEZ></E1EDL27></E1EDL26><E1EDL35
SEGMENT="1"><STAWN>6404199000</STAWN><EXART>10</EXART><HERKL>CN</HERKL><HERKR>SO</HERKR><GRWRT>391.85</GRWRT><E1EDL36
SEGMENT="1"><EXART_BEZ>Standard Sale or
Purchase</EXART_BEZ><HERKL_BEZ>China</HERKL_BEZ></E1EDL36></E1EDL35><E1EDL43
SEGMENT="1"><QUALF>V</QUALF><BELNR>0061025409</BELNR><POSNR>000100</POSNR></E1EDL43></E1EDL24></E1EDT20><EDI_DS40
SEGMENT="1"><MANDT>500</MANDT><DOCNUM>0000000581904575</DOCNUM><LOGDAT>20180614</LOGDAT><LOGTIM>114718</LOGTIM><STATUS>01</STATUS><STAMNO>000</STAMNO><UNAME>KFOSTER</UNAME><SEGNUM>000000</SEGNUM></EDI_DS40><EDI_DS40
SEGMENT="1"><MANDT>500</MANDT><DOCNUM>0000000581904575</DOCNUM><LOGDAT>20180614</LOGDAT><LOGTIM>114718</LOGTIM><STATUS>30</STATUS><STAMQU>SAP</STAMQU><STAMID>B1</STAMID><STAMNO>006</STAMNO><STATYP>S</STATYP><STAPA1>Receiver
exists</STAPA1><STAPA2>No
filters</STAPA2><STAPA3>No
conversion</STAPA3><STAPA4>No version
change</STAPA4><STATXT><![CDATA[&, &, &,
&]]></STATXT><UNAME>KFOSTER</UNAME><SEGNUM>000000</SEGNUM></EDI_DS40><EDI_DS40
SEGMENT="1"><MANDT>500</MANDT><DOCNUM>0000000581904575</DOCNUM><LOGDAT>20180614</LOGDAT><LOGTIM>115859</LOGTIM><STATUS>03</STATUS><STAMQU>SAP</STAMQU><STAMID>EA</STAMID><STAMNO>095</STAMNO><STATYP>I</STATYP><STAPA1>http://manhattaneis:13029</STAPA1><STAPA4>HTTP Response
Code:200</STAPA4><STATXT>IDoc sent by HTTP in XML
format</STATXT><UNAME>TWSUSER</UNAME><REPID>LEDI7F10</REPID><SEGNUM>000000</SEGNUM></EDI_DS40></IDOC></SHPMNT05>
我想知道我是否使用了不正确的路径名,但是我尝试了多个选项,但它仍然只是作为空值传递。
我只需要传递示例IDOC的一部分,因为它太大而无法在本文的正文中发布,但是如果需要访问,我可以将其上传到某个地方?
是'and'限定词不对吗?
请帮助我迷失方向!
答案 0 :(得分:1)
要使其正常工作,请尝试将其更改为以下内容。我更改了xsl:if
和xsl:value
的XPath。此时,在XSLT中,current()
节点是for循环中的E1EDT20
,而E1EDT10
是它的直接子代,因此我从表达式中删除了../IDOC/E1EDT20/
。更改的第二件事是将VSTZW_BEZ
值包装在normalize-space(...)
中
,因为其值“到期DC日期”分为两行。查看您的XML,您应该养成这种改变的习惯。
这是修改后的代码:
<ShippedDate>
<xsl:value-of select="name()" />
<xsl:if test="E1EDT10[QUALF='499' and normalize-space(VSTZW_BEZ)='Due DC Date']/NTANF != '00000000'">
<xsl:value-of select="E1EDT10[QUALF='499' and normalize-space(VSTZW_BEZ)='Due DC Date']/NTANF"/>
</xsl:if>
</ShippedDate>