Sample input data
interfaceSourceCode,requisitioningBUName,InterfaceHeaderKey,CategoryName,CurrencyCode,DeliverToLocationCode,DeliverToOrganizationCode,DestinationTypeCode,InterfaceLineKey,ItemDescription,ItemNumber,LineType,NoteToBuyer,ProcurementBUName,Quantity,RequesterEmail,UnitOfMeasureCode,Price,ChargeAccountSegment1,ChargeAccountSegment2,ChargeAccountSegment3,ChargeAccountSegment4,ChargeAccountSegment5,ChargeAccountSegment6,ChargeAccountSegment7,DistributionQuantity,InterfaceDistributionKey,Percent
SCO,XXXX Internal Customer Service - CA,300000039139651,"Chemicals, Lubricants and Non-Gen Fuels.Additives.Additives",CAD,Nisku Distribution Centre,NDC,INVENTORY,400000039139652,"TRANSFORMER, 25 KVA OH, 12470GRDY/7200/347/600Y 1PH C/W TAPS SPEC. #YECL-T-15",16340094,Goods,TEST12345678,XXXX Internal Customer Service - CA,6,xyz@discard.mail.us2.oracle.cloud.com,zzr,500,10002,00000,00000,00000,130000,00000,00,6,500000039139652,100
SCO,XXXX Internal Customer Service - CA,300000039139651,"Chemicals, Lubricants and Non-Gen Fuels.Additives.Additives",CAD,Nisku Distribution Centre,NDC,INVENTORY,400000039139653,"TRANSFORMER, 25 KVA OH, 12470GRDY/7200/347/600Y 1PH C/W TAPS SPEC. #YECL-T-15",16340094,Goods,TEST12345678,XXXX Internal Customer Service - CA,6,xyz@discard.mail.us2.oracle.cloud.com,zzr,500,10002,00000,00000,00000,130000,00000,00,6,500000039139653,100
SCO,XXXX Internal Customer Service - CA,300000039139652,"Chemicals, Lubricants and Non-Gen Fuels.Additives.Additives",CAD,Nisku Distribution Centre,NDC,INVENTORY,400000039139654,"TRANSFORMER, 25 KVA OH, 12470GRDY/7200/347/600Y 1PH C/W TAPS SPEC. #YECL-T-15",16340094,Goods,TEST12345678,XXXX Internal Customer Service - CA,6,xyz@discard.mail.us2.oracle.cloud.com,zzr,500,10002,00000,00000,00000,130000,00000,00,6,500000039139654,100
SCO,XXXX Internal Customer Service - CA,300000039139652,"Chemicals, Lubricants and Non-Gen Fuels.Additives.Additives",CAD,Nisku Distribution Centre,NDC,INVENTORY,400000039139655,"TRANSFORMER, 25 KVA OH, 12470GRDY/7200/347/600Y 1PH C/W TAPS SPEC. #YECL-T-15",16340094,Goods,TEST12345678,XXXX Internal Customer Service - CA,6,xyz@discard.mail.us2.oracle.cloud.com,zzr,500,10002,00000,00000,00000,130000,00000,00,6,500000039139655,100
我想编写XSLT转换,根据接口源代码,requisitionbuname对其进行分组,然后循环访问InterfaceHeaderKey。 PLS。建议
答案 0 :(得分:1)
考虑使用for-each-group xslt 2.0构造.....
<xsl:for-each-group select="//put your parent tag here let say interfaceSourceCode" group-by="//put your element">
<xsl:for-each-group select="current-group().. if next grouping element is at same level or change accordingly" group-by="..put second grouping element let say requisitioningBUName and so on">
<xsl:for-each select="//element let say InterfaceHeaderKey">
.....values go here
</xsl:for-each>
</xsl:for-each-group>
</xsl:for-each-group>