Hi,
I’ve encountered some behaviour that I can’t understand in
a transformation that I’m currently engaged on. The transformations
are all pretty simple and follow the same pattern, but with just a few of them
I’m getting odd results where the element text is not being output.
For example, in one case I have the following xsl:
…
…
<!--
Instance -->
<xsl:for-each
select="Instance">
<Instance>
<NUMHUS>
<xsl:value-of select="NUMHUS/text()"/>
</NUMHUS>
<REDUCEDI>
<xsl:attribute name="codeListAgencyName">
<xsl:text>HESA</xsl:text>
</xsl:attribute>
<xsl:attribute name="codeListName">
<xsl:text>REDUCEDI</xsl:text>
</xsl:attribute>
<xsl:attribute name="languageID">
<xsl:text>en</xsl:text>
</xsl:attribute>
<xsl:value-of select="REDUCEDI/text()"/>
</REDUCEDI>
<COURSEID>
<xsl:value-of select="COURSEID/text()"/>
</COURSEID>
…
The source document has the following:
<Instance>
<NUMHUS>000001075369710892 </NUMHUS>
<personal_id>02002538</personal_id>
<REDUCEDI>00</REDUCEDI>
…
<COURSEID>62105201
</COURSEID>
…
(Note that <personal_id> is not transferred to the output
document)
The destination document gives:
<Instance>
<NUMHUS>000001070027710892 </NUMHUS>
<REDUCEDI codeListAgencyName="HESA"
codeListName="REDUCEDI"
languageID="en"/>
<COURSEID>53705101
</COURSEID>
…
My problem is the <REDUCEDI> element. I don’t
understand why it hasn’t taken the text ‘00’ into the
destination document as I was expecting.
I’ve got what I take to be the same problem elsewhere, so I’m
hoping that solving it here will give the solution elsewhere as well.
Thanks in advance
Peter