XSLT to move nodes

Here should go questions about transforming XML with XSLT and FOP.
GopalJay
Posts: 1

XSLT to move nodes

Wed Jan 17, 2018 4:46 pm

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

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest