Mon entrée xml est:Fusion noeuds XML avec des valeurs de nœud enfant identiques en utilisant XSLT
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Row>
<EmployeeID>21001</EmployeeID>
<FMLAStartDate>2017-10-10</FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21002</EmployeeID>
<FMLAStartDate>2017-10-10</FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21002</EmployeeID>
<FMLAStartDate></FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate>2017-10-08</LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21003</EmployeeID>
<FMLAStartDate></FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate>2017-05-01</LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21004</EmployeeID>
<FMLAStartDate></FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate>2017-01-10</FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
</Root>
Notez que 21002 des employés a deux noeuds, un tenant la date FMLA début et autre tenant la date de fin LTD. L'attente de transformation Post XSLT consiste à avoir un nœud de ligne par ID d'employé et ce nœud de ligne doit contenir l'intégralité de l'information pour cet ID d'employé. Par conséquent la production attendue est:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Row>
<EmployeeID>21001</EmployeeID>
<FMLAStartDate>2017-10-10</FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21002</EmployeeID>
<FMLAStartDate>2017-10-10</FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate>2017-10-08</LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21003</EmployeeID>
<FMLAStartDate></FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate></FMLACorrectDate>
<LTDStartDate>2017-05-01</LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
<Row>
<EmployeeID>21004</EmployeeID>
<FMLAStartDate></FMLAStartDate>
<FMLAEndDate></FMLAEndDate>
<FMLACorrectDate>2017-01-10</FMLACorrectDate>
<LTDStartDate></LTDStartDate>
<LTDEndDate></LTDEndDate>
<LTDCorrectdate></LTDCorrectdate>
</Row>
</Root>
J'ai essayé de-chaque groupe pour le regroupement en fonction d'identification de l'employé, mais il ne donne pas une sortie correcte. Quelqu'un peut-il m'aider s'il vous plaît avec ceci? J'ai des connaissances de base sur XSLT mais je n'ai pas travaillé avec des fonctionnalités avancées de XSLT.
Merci!
Nous ne pouvons pas trouver les bugs dans votre code, sauf si vous nous montrez le code. –