Please see the below XML. In the XML the name element is a self closing empty tag. I need to add a text value to this name element tag. This chunk of XML code might be repeated any number of times in the whole XML.
<participant typeCode="LOC">
<participantRole classCode="SDLOC">
<id extension="00000000-0000-0000-0000-000000000000" root="1.0"/>
<addr nullFlavor="UNK"/>
<playingEntity>
<name/>
</playingEntity>
</participantRole>
</participant>
Expected Output: Need to add the UNK text value for the self closing empty name element tag.
<participant typeCode="LOC">
<participantRole classCode="SDLOC">
<id extension="00000000-0000-0000-0000-000000000000" root="1.0"/>
<addr nullFlavor="UNK"/>
<playingEntity>
<name>UNK</name>
</playingEntity>
</participantRole>
</participant>
I need an XSLT script to achieve this requirement.
Thanks,
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…