XSLT to move nodes

Here should go questions about transforming XML with XSLT and FOP.
GopalJay
Posts: 1
Joined: Wed Jan 17, 2018 4:41 pm

XSLT to move nodes

Post by GopalJay »

I have the below xml:

Code: Select all

<contrib-group>
<contrib contrib-type="author"><name><surname>Hieda</surname><given-names>Naoto</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Iga</surname><given-names>Yoshinori</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Goto</surname><given-names>Tetsuhisa</given-names></name><xref ref-type="aff" rid="aff2"/></contrib>
<aff id="aff1">Megmilk Snow Brand Co., Ltd.</aff>
<aff id="aff2">Shinshu University (retired).</aff>
</contrib-group>

And I want to output as follows:

Code: Select all

<contrib-group>
<contrib contrib-type="author"><name><surname>Hieda</surname><given-names>Naoto</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Iga</surname><given-names>Yoshinori</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<aff id="aff1">Megmilk Snow Brand Co., Ltd.</aff>
<contrib contrib-type="author"><name><surname>Goto</surname><given-names>Tetsuhisa</given-names></name><xref ref-type="aff" rid="aff2"/></contrib>
<aff id="aff2">Shinshu University (retired).</aff>
</contrib-group>

Can anybody help me how to achieve through XSLT.

Thanks,
Gopal