Could someone help me modify my xslt code below so I can get output for both
QualifyingRelationshipCode and
QualifyingRelationshipText
Right now I am only getting output for
QualifyingRelationshipCode but I am not getting
QualifyingRelationshipText output.
Here is the output I am getting which is wrong. this:
Code:
<ext:QualifyingRelationship>
<ext:QualifyingRelationshipCode>CHLDTOGTHR</ext:QualifyingRelationshipCode>
<ext:QualifyingRelationshipCode>LIVTOGTHR</ext:QualifyingRelationshipCode>
<ext:QualifyingRelationshipText/>
<ext:QualifyingRelationshipText/>
</ext:QualifyingRelationship>
Result I want to see
Code:
<ext:QualifyingRelationship>
<ext:QualifyingRelationshipCode>CHLDTOGTHR</ext:QualifyingRelationshipCode>
<ext:QualifyingRelationshipCode>LIVTOGTHR</ext:QualifyingRelationshipCode>
<ext:QualifyingRelationshipText>Have a child together</ext:QualifyingRelationshipText>
<ext:QualifyingRelationshipText>Lived Together</ext:QualifyingRelationshipText>
</ext:QualifyingRelationship>
My xslt code
Code:
<xsl:for-each select="MNProtectionOrderAdditional/QualifyingRelationships">
<ext:QualifyingRelationship>
<xsl:for-each select="QualifyingRelationship">
<ext:QualifyingRelationshipCode>
<xsl:value-of select="@Word"/>
</ext:QualifyingRelationshipCode>
</xsl:for-each>
<xsl:for-each select="QualifyingRelationship">
<ext:QualifyingRelationshipText>
<xsl:value-of select="QualifyingRelationship"/>
</ext:QualifyingRelationshipText>
</xsl:for-each>
</ext:QualifyingRelationship>
</xsl:for-each>
Here is the xml document which is transformed by the code above (xslt)
XML Code
Code:
<QualifyingRelationships>
<QualifyingRelationship Word="CHLDTOGTHR">Have a child together</QualifyingRelationship>
<QualifyingRelationship Word="LIVTOGTHR">Lived Together</QualifyingRelationship>
</QualifyingRelationships>