JD Edwards for EDIのカスタム請求書プログラムの出力を変換する必要があります。レポートから出て来るXMLデータは形成されていません。私はEDI要件を満たすためにデータを再構成するのに苦労しています。私はXSLの初心者ですので、試行錯誤して結果に到達しています。XSL変換が失敗したXML出力のJD Edwardsレポートで失敗する
私が直面している課題の1つは、レポートがデータを適切に構成していないことです。以下のXML入力で見られるように、請求書の行は請求書ヘッダーの適切な子孫ではありません。私は開発者に、請求書番号に基づいてデータを再構成できるように、各セクションに請求書番号を追加してもらいました。
私の質問は、適切な親子/兄弟構造を作成して、結果が希望の結果と一致するようにXSLスタイルシートのコードを変更するにはどうすればよいですか?これは、XSLスタイルシートの実行時に、私が実際に取得していますものです
<R5942015>
<Invoices>
<InvNumber>8729266</InvNumber>
<InvoiceDate>2016-04-07</InvoiceDate>
<ShipmentNumber>169638</ShipmentNumber>
<ShipDate>2016-04-06</ShipDate>
<CustomerNumber>10779</CustomerNumber>
<DealerNumber>44014104</DealerNumber>
<line>
<ITEMLineNumber>13</ITEMLineNumber>
<ITEM2ndItemNumber>010799</ITEM2ndItemNumber>
<QTYShipped>2</QTYShipped>
<AMTLineExtendedPrice>1230.00</AMTLineExtendedPrice>
<AMTLandedFreight>54.78</AMTLandedFreight>
</line>
<summary>
<QTYOrdered>2</QTYOrdered>
<QTYShipped>2</QTYShipped>
<AMTLandedFreight>54.78</AMTLandedFreight>
<AMTExtendedPrice>1230.00</AMTExtendedPrice>
<AMTGrandTotal>1284.78</AMTGrandTotal>
</summary>
<messages>
<MSGServiceCharge>Service charge message...</MSGServiceCharge>
</messages>
</Invoices>
<Invoices>
<InvNumber>8729267</InvNumber>
<InvoiceDate>2016-04-07</InvoiceDate>
<ShipmentNumber>169638</ShipmentNumber>
<ShipDate>2016-04-06</ShipDate>
<CustomerNumber>11005</CustomerNumber>
<DealerNumber>50857355</DealerNumber>
<line>
<ITEMLineNumber>3</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>665.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>4</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>665.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>5</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>715.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>11</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>665.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>21</ITEMLineNumber>
<ITEM2ndItemNumber>016799</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>630.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>23</ITEMLineNumber>
<ITEM2ndItemNumber>010765</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>600.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>24</ITEMLineNumber>
<ITEM2ndItemNumber>P10512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>715.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>62</ITEMLineNumber>
<ITEM2ndItemNumber>016799</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>630.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<summary>
<QTYOrdered>8</QTYOrdered>
<QTYShipped>8</QTYShipped>
<AMTLandedFreight>181.12</AMTLandedFreight>
<AMTExtendedPrice>5285.00</AMTExtendedPrice>
<AMTGrandTotal>5466.12</AMTGrandTotal>
</summary>
<messages>
<MSGServiceCharge>Service charge message...</MSGServiceCharge>
</messages>
</Invoices>
</R5942015>
:
<R5942015>
<Main___F4211_F42119_S1>
<Header_S2>
<ShipDate_ID11>2016-04-06</ShipDate_ID11>
<CustomerNumber_ID92>10779</CustomerNumber_ID92>
<InvoiceDate_ID107>2016-04-07</InvoiceDate_ID107>
<DealerNumber_ID6>44014104</DealerNumber_ID6>
<ShipmentNumber_ID70>169638</ShipmentNumber_ID70>
<InvoiceNumber_ID62>8729266</InvoiceNumber_ID62>
</Header_S2>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>13</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>1230.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>010799</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729266</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>2</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>54.78</AckLine_Freight_ID21>
</Line_Info_S4>
<Summary_Info_S8>
<AckExtendedPrice_T_ID2>1230.00</AckExtendedPrice_T_ID2>
<Freight_T_ID6>54.78</Freight_T_ID6>
<GrandTotal_T_ID17>1284.78</GrandTotal_T_ID17>
<DisplayInvoiceNumber_ID39>8729266</DisplayInvoiceNumber_ID39>
</Summary_Info_S8>
<Remit_To_S11>
<Invoice_No__ID19>Invoice No:</Invoice_No__ID19>
<DisplayInvoiceNumber_ID18>8729266</DisplayInvoiceNumber_ID18>
<Service_Charge_Message_ID14>Service charge message...</Service_Charge_Message_ID14>
</Remit_To_S11>
<Header_S2>
<ShipDate_ID11>2016-04-06</ShipDate_ID11>
<CustomerNumber_ID92>11005</CustomerNumber_ID92>
<InvoiceDate_ID107>2016-04-07</InvoiceDate_ID107>
<DealerNumber_ID6>50857355</DealerNumber_ID6>
<ShipmentNumber_ID70>169638</ShipmentNumber_ID70>
<InvoiceNumber_ID62>8729267</InvoiceNumber_ID62>
</Header_S2>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>3</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>665.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>010512</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>4</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>665.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>010512</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>5</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>715.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>010512</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>11</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>665.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>010512</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>21</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>630.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>016799</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>23</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>600.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>010765</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>24</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>715.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>P10512</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
</Main___F4211_F42119_S1>
<Main___F4211_F42119_S1>
<Line_Info_S4>
<AckLineNumber_D_ID1>62</AckLineNumber_D_ID1>
<LineExtendedPrice_D_ID8>630.00</LineExtendedPrice_D_ID8>
<_nd_Item_Number_D_ID3>016799</_nd_Item_Number_D_ID3>
<DisplayInvoiceNumber_ID42>8729267</DisplayInvoiceNumber_ID42>
<LineQuantityShipped_D_ID35>1</LineQuantityShipped_D_ID35>
<AckLine_Freight_ID21>22.64</AckLine_Freight_ID21>
</Line_Info_S4>
<Summary_Info_S8>
<AckExtendedPrice_T_ID2>5285.00</AckExtendedPrice_T_ID2>
<Freight_T_ID6>181.12</Freight_T_ID6>
<GrandTotal_T_ID17>5466.12</GrandTotal_T_ID17>
<DisplayInvoiceNumber_ID39>8729267</DisplayInvoiceNumber_ID39>
</Summary_Info_S8>
<Remit_To_S11>
<Invoice_No__ID19>Invoice No:</Invoice_No__ID19>
<DisplayInvoiceNumber_ID18>8729267</DisplayInvoiceNumber_ID18>
<Service_Charge_Message_ID14>Service charge message...</Service_Charge_Message_ID14>
</Remit_To_S11>
</Main___F4211_F42119_S1>
</R5942015>
これは、EDIのための所望の出力は次のようになります。ここでは
は、XML入力です。最初の請求書の明細行、概要およびメッセージは、実際に2番目の請求書のヘッダーの後に表示されます。<R5942015>
<Invoices>
<InvNumber>8729266</InvNumber>
<InvoiceDate>2016-04-07</InvoiceDate>
<ShipmentNumber>169638</ShipmentNumber>
<ShipDate>2016-04-06</ShipDate>
<CustomerNumber>10779</CustomerNumber>
<DealerNumber>44014104</DealerNumber>
</Invoices>
<Invoices>
<InvNumber>8729267</InvNumber>
<InvoiceDate>2016-04-07</InvoiceDate>
<ShipmentNumber>169638</ShipmentNumber>
<ShipDate>2016-04-06</ShipDate>
<CustomerNumber>11005</CustomerNumber>
<DealerNumber>50857355</DealerNumber>
<line>
<ITEMLineNumber>13</ITEMLineNumber>
<ITEM2ndItemNumber>010799</ITEM2ndItemNumber>
<QTYShipped>2</QTYShipped>
<AMTLineExtendedPrice>1230.00</AMTLineExtendedPrice>
</line>
<summary>
<QTYOrdered>2</QTYOrdered>
<QTYShipped>2</QTYShipped>
<AMTExtendedPrice>1230.00</AMTExtendedPrice>
<AMTGrandTotal>1284.78</AMTGrandTotal>
</summary>
<messages>
<MSGServiceCharge>Service charge message...</MSGServiceCharge>
</messages>
<line>
<ITEMLineNumber>3</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>665.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>4</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>665.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>5</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>715.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>11</ITEMLineNumber>
<ITEM2ndItemNumber>010512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>665.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>21</ITEMLineNumber>
<ITEM2ndItemNumber>016799</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>630.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>23</ITEMLineNumber>
<ITEM2ndItemNumber>010765</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>600.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
<line>
<ITEMLineNumber>24</ITEMLineNumber>
<ITEM2ndItemNumber>P10512</ITEM2ndItemNumber>
<QTYShipped>1</QTYShipped>
<AMTLineExtendedPrice>715.00</AMTLineExtendedPrice>
<AMTLandedFreight>22.64</AMTLandedFreight>
</line>
</Invoices>
<Invoices>
<summary>
<QTYOrdered>8</QTYOrdered>
<QTYShipped>8</QTYShipped>
<AMTExtendedPrice>5285.00</AMTExtendedPrice>
<AMTGrandTotal>5466.12</AMTGrandTotal>
</summary>
<messages>
<MSGServiceCharge>Service charge message...</MSGServiceCharge>
</messages>
</Invoices>
</R5942015>
これは、不適切な形式のXMLを回避しようとしているので、私がスタイルシートについて思いついたものです。 XSLの新機能ですから、簡単に進んでください。
ありがとうございます。あなたがこの同じ話題に関する私の以前の質問を見たなら、質問の貧弱な構造についてお詫び申し上げます。
あなたのQ書き込み能力を向上させるために、がんばろう。 – shellter