fsxml/formula/ingrrow
where itemcode = fsxml/item
(attribute objkey
) を結合し、 from item で指定された要素を each の最後の要素の後に移動してerpplantnr_11
、次の XML を並べ替えます。erpplantnr_30
attribute10
ingrrow
提供できるヘルプを事前にありがとう!
(単純化して最初の XSLT 試行を提供) (単純化された例 - 属性 objkey が itemcode 要素と一致する attribute1 要素の後に erpplantnr_11 要素を移動したい)
「結合」の作成方法に関するヘルプを探しています。再度、感謝します。
(XSLT):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:fsxml="http://www.FormationSystems.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="formula">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="ingrrow"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ingrrow | item">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="itemcode"/>
<xsl:apply-templates select="attribute1"/>
<xsl:apply-templates select="erpplantnr_11"/>
</xsl:copy>
</xsl:template>
<xsl:template match="fsxml/fsxml">
<xsl:apply-templates select="item"/>
</xsl:template>
</xsl:stylesheet>
結果の XML - 2 つの項目 objectkey 属性をそれらの ingrow itemcodes と一致させ、出力 xml で attribute1 要素の後に erpplantnr_11 要素をリストする必要があります。
<fsxml>
<formula maxcol="51" keycount="2" fmt="A" dtlcodes="HEADER\INGR" objectkey="NOR000133\0002" filteredfields="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ingrrow detail="1" fmt="X">
<itemcode>NOR60506</itemcode>
<attribute1>000000000050051116</attribute1>
</ingrrow>
<ingrrow detail="1" fmt="X">
<itemcode>7K015</itemcode>
<attribute1>000000000000800479</attribute1>
</ingrrow>
</formula>
<item maxcol="35" keycount="1" fmt="A" dtlcodes="HEADER" objectkey="NOR60506" filteredfields="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<erpplantnr_11>121212;343434</erpplantnr_11>
</item>
<item maxcol="35" keycount="1" fmt="A" dtlcodes="HEADER" objectkey="7K015" filteredfields="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<erpplantnr_11>123456</erpplantnr_11>
</item>
</fsxml>
元の XML:
<fsxml>
<formula maxcol="51" keycount="2" fmt="A" dtlcodes="HEADER\INGR" objectkey="NOR000133\0002" filteredfields="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<keycode>NOR000133</keycode>
<keycode2>0002</keycode2>
<description>48782 ALABASTER WHITE MB9960 NA</description>
<formulaalias />
<alternateformula />
<timedate xsi:nil="true" />
<productcode />
<productdescr />
<reportcode />
<reportregion />
<alias_code1 />
<alias_code2 />
<alias_code3 />
<alias_code4 />
<alias_code5 />
<alias_code6 />
<alias_code7 />
<alias_code8 />
<hseapacdoc />
<hseemeadoc />
<hsenasadoc />
<wau_local_designee />
<apac1_local_designee />
<apac2_local_designee />
<apc_local_designee />
<emea_local_designee />
<na_local_designee>PREST</na_local_designee>
<sa_local_designee />
<ras_sent>Yes</ras_sent>
<erp_waunr />
<erp_apac1nr />
<erp_apac2nr />
<erp_apcnr />
<erp_emeanr />
<erp_nornr />
<erp_sanr />
<crfc_code>NOR000133</crfc_code>
<orig_desc />
<erpglobal_1 />
<erpglobal_2 />
<erpglobal_3 />
<uomcode>KG</uomcode>
<itemcode>NOR000133</itemcode>
<yield>74.8956541853986</yield>
<yieldpct>100</yieldpct>
<phantomind>0</phantomind>
<primaryformulaind>1</primaryformulaind>
<processyield>100</processyield>
<projectcode />
<labbookcode />
<labbookpage />
<ownercode>ARFTL</ownercode>
<groupcode>GROUP_1</groupcode>
<statusind>291</statusind>
<approvalcode />
<holdcode />
<workcode />
<workcode2 />
<formulatorcode>ARFTL</formulatorcode>
<yieldcalcind>1</yieldcalcind>
<customer>RO_NOR</customer>
<comment />
<datemodified>2012-05-11T14:55:37</datemodified>
<class>PRODUCT</class>
<typeind>0</typeind>
<parentfid>42871</parentfid>
<mfgitemmaster>NOR000133\0002</mfgitemmaster>
<calcmode>0</calcmode>
<formulaid>728067</formulaid>
<adjustparam />
<materialchange>1</materialchange>
<judgement />
- <ingrrow detail="1" fmt="X">
<lineid>1</lineid>
<itemcode>NOR60506</itemcode>
<quantity>66.6877872652848</quantity>
<uomcode>KG</uomcode>
<description>KV1348 KV1348 White Dispersion</description>
<materialpct>89.0409303324918</materialpct>
<linebreakcode />
<scaleind>0</scaleind>
<subformulaind>0</subformulaind>
<formulaid>0</formulaid>
<componentind>1</componentind>
<instruction />
<substituteind>0</substituteind>
<formulacode>NOR60506\0006</formulacode>
<status>401</status>
<class />
<decdigit>0</decdigit>
<cas />
<commcode />
<aliascode1 />
<aliascode2 />
<aliascode3 />
<aliascode4 />
<activequantity>0</activequantity>
<relqtypct>0</relqtypct>
<attribute1>000000000050051116</attribute1>
<attribute2 />
<attribute3 />
<attribute4 />
<attribute5 />
<instrucflag>1</instrucflag>
<paramcode />
<pvalue xsi:nil="true" />
<lotcode />
<aliascode5 />
<aliascode6 />
<aliascode7>APC 56% 5T070/3Z145 (KV1348) / P:393367</aliascode7>
<aliascode8 />
<sectionname />
<sectiontype>0</sectiontype>
<adjustind>0</adjustind>
<attribute6 />
<attribute7 />
<attribute8 />
<attribute9 />
<attribute10 />
</ingrrow>
- <ingrrow detail="1" fmt="X">
<lineid>2</lineid>
<itemcode>7K015</itemcode>
<quantity>8.20786692011385</quantity>
<uomcode>KG</uomcode>
<description>METHYLAMYLKETONE</description>
<materialpct>10.9590696675082</materialpct>
<linebreakcode />
<scaleind>0</scaleind>
<subformulaind>0</subformulaind>
<formulaid>0</formulaid>
<componentind>8</componentind>
<instruction />
<substituteind>0</substituteind>
<status>401</status>
<class />
<decdigit>0</decdigit>
<cas>110-43-0</cas>
<commcode />
<aliascode1>S194</aliascode1>
<aliascode2>METHYL AMYL KETONE</aliascode2>
<aliascode3 />
<aliascode4>METHYLAMYLKETONE</aliascode4>
<activequantity>0</activequantity>
<relqtypct>0</relqtypct>
<attribute1>000000000000800479</attribute1>
<attribute2 />
<attribute3 />
<attribute4 />
<attribute5 />
<instrucflag>1</instrucflag>
<paramcode />
<pvalue xsi:nil="true" />
<lotcode />
<aliascode5>METHYLAMYLKETONE</aliascode5>
<aliascode6>Methylamylketon 165,5 KG</aliascode6>
<aliascode7>METHYL N-AMYL KETONE (Bulk)</aliascode7>
<aliascode8 />
<sectionname />
<sectiontype>0</sectiontype>
<adjustind>0</adjustind>
<attribute6 />
<attribute7 />
<attribute8 />
<attribute9 />
<attribute10 />
</ingrrow>
</formula>
- <fsxml>
- <item maxcol="35" keycount="1" fmt="A" dtlcodes="HEADER" objectkey="NOR60506" filteredfields="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<keycode>NOR60506</keycode>
<description>KV1348 White Dispersion</description>
<rmremark />
<ras_sent />
<erp_waunr />
<erp_apac1nr />
<erp_apac2nr />
<erp_apcnr />
<erp_emeanr />
<erp_nornr>000000000050051116</erp_nornr>
<erp_sanr />
<erpglobal_1 />
<erpglobal_2 />
<erpglobal_3 />
<erpplantnr_11>121212;343434</erpplantnr_11>
<erpplantnr_12 />
<erpplantnr_13 />
<erpplantnr_14 />
<erpplantnr_15 />
<erpplantnr_16 />
<erpplantnr_17 />
<erpplantnr_18 />
<erpplantnr_19 />
<erpplantnr_20 />
<erpplantnr_21 />
<erpplantnr_22 />
<erpplantnr_23 />
<erpplantnr_24 />
<erpplantnr_25 />
<erpplantnr_26 />
<erpplantnr_27 />
<erpplantnr_28 />
<erpplantnr_29 />
<erpplantnr_30 />
<uomcode>KG</uomcode>
<calcind>0</calcind>
<scaleind>0</scaleind>
<statusind>401</statusind>
<approvalcode />
<class />
<componentind>1</componentind>
<linebreakcode />
<holdcode />
<formulacode>NOR60506</formulacode>
<version>0006</version>
<cas />
<commcode />
<aliascode1 />
<aliascode2 />
<aliascode3 />
<aliascode4 />
<aliascode5 />
<aliascode6 />
<aliascode7>APC 56% 5T070/3Z145 (KV1348) / P:393367</aliascode7>
<aliascode8 />
<threshold>0</threshold>
<datemodified>2012-04-28T19:50:12</datemodified>
<ftypeind>0</ftypeind>
<judgement />
</item>
- <item maxcol="35" keycount="1" fmt="A" dtlcodes="HEADER" objectkey="7K015" filteredfields="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<keycode>7K015</keycode>
<description>METHYLAMYLKETONE</description>
<rmremark />
<ras_sent />
<erp_waunr>S194</erp_waunr>
<erp_apac1nr>00000000000007K015</erp_apac1nr>
<erp_apac2nr />
<erp_apcnr>7K015</erp_apcnr>
<erp_emeanr>000000000000800479</erp_emeanr>
<erp_nornr>000000000000800479</erp_nornr>
<erp_sanr />
<erpglobal_1 />
<erpglobal_2 />
<erpglobal_3 />
<erpplantnr_11>123456</erpplantnr_11>
<erpplantnr_12>234567</erpplantnr_12>
<erpplantnr_13>345678</erpplantnr_13>
<erpplantnr_14>456789</erpplantnr_14>
<erpplantnr_15>567890</erpplantnr_15>
<erpplantnr_16>678901</erpplantnr_16>
<erpplantnr_17>789012</erpplantnr_17>
<erpplantnr_18>890123</erpplantnr_18>
<erpplantnr_19>901234</erpplantnr_19>
<erpplantnr_20>012345</erpplantnr_20>
<erpplantnr_21>654321</erpplantnr_21>
<erpplantnr_22>765432</erpplantnr_22>
<erpplantnr_23>876543</erpplantnr_23>
<erpplantnr_24>987654</erpplantnr_24>
<erpplantnr_25>098765</erpplantnr_25>
<erpplantnr_26>109876</erpplantnr_26>
<erpplantnr_27>210987</erpplantnr_27>
<erpplantnr_28>321098</erpplantnr_28>
<erpplantnr_29>432109</erpplantnr_29>
<erpplantnr_30>543210</erpplantnr_30>
<uomcode>KG</uomcode>
<calcind>0</calcind>
<scaleind>0</scaleind>
<statusind>401</statusind>
<approvalcode />
<class />
<componentind>8</componentind>
<linebreakcode />
<holdcode />
<formulacode />
<version />
<cas>110-43-0</cas>
<commcode />
<aliascode1>S194</aliascode1>
<aliascode2>METHYL AMYL KETONE</aliascode2>
<aliascode3 />
<aliascode4>METHYLAMYLKETONE</aliascode4>
<aliascode5>METHYLAMYLKETONE</aliascode5>
<aliascode6>Methylamylketon 165,5 KG</aliascode6>
<aliascode7>METHYL N-AMYL KETONE (Bulk)</aliascode7>
<aliascode8 />
<threshold>0</threshold>
<datemodified>2012-04-24T22:52:56</datemodified>
<ftypeind>0</ftypeind>
<judgement />
</item>
</fsxml>
</fsxml>