Hello, everyone,
I wrote a large XSL file 2 months ago and now I found a bug in it. It seems that my transformer doesn't see that the source xml file has some tags and does not produce needed output.
When I have this source:
<root>
...
<biography>
<bg>
<i fname="#1043;#1077;#1086;#1088;#1075;#1080;" ind_id="34" lname="#1063;o#1083;#1072;#1082;#1086;#1074;" egn="7509234443" email="
[email protected]">
<deg_rank/>
</i>
</bg>
<en>
<i email="
[email protected]" ind_id="34" fname="Georgi" lname="Cholakov" birthdate="23 Sep 1975">
<deg_rank/>
</i>
</en>
</biography>
...
</root>
And this XSL piece:
<fo:block font-size="11pt" font-family="Arial" margin-left="3pt">
<xsl:for-each select="/root/biography/bg/i/deg_rank[@type != 'P']">
<xsl:sort select="@type"/>
<xsl:value-of select="@name"/>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
<xsl:text> </xsl:text>
<xsl:value-of select="/root/biography/bg/i[1]/@lname"/>
<xsl:text> </xsl:text>
<xsl:value-of select="/root/biography/bg/i[1]/@fname"/>
<xsl:text> </xsl:text>
<xsl:value-of select="/root/biography/bg/i[1]/@mname"/>
</fo:block>
I do not get the output, but when I have this source:
<biography>
<bg>
<i fname="#1043;#1077;#1086;#1088;#1075;#1080;" ind_id="34" lname="#1063;o#1083;#1072;#1082;#1086;#1074;" egn="7509234443" email="
[email protected]">
<deg_rank type="R" year="1998" name="1st rank" authors="auth"/>
</i>
</bg>
<en>
<i email="
[email protected]" ind_id="34" fname="Georgi" lname="Cholakov" birthdate="23 Sep 1975">
<deg_rank type="R" year="1998" name="1st rank en" authors="auth"/>
</i>
</en>
</biography>
It produces the output I need. The difference is only that the <deg_rank> tag has attributes in the second case. Why is all that? All myh paths are correct, because in the second cae it works.
Also with the first source a template is not working:
<xsl:template match="root/biography/bg/i | root/biography/en/i">
If somebody can spend a little more time I could send him/her both the source and the XSL which are a bit long and complex. For just two months I have forgotten much of this stuff, any help would be appreciated.