EDN Admin
Well-known member
HI.
i have two xml file:
first
<my:e1>42</my:e1><br/>
<my:e2 xsi:nil="true </my:e2><br/>
<my:e3>false</my:e3><br/>
<my:e4>EUR</my:e4>
second
<my:e1>43</my:e1><br/>
<my:e2>3</my:e2><br/>
<my:e3>false</my:e3><br/>
<my:e4>EUR</my:e4>
and XSLT file to convert
<xsl:template match ="my:Fields
<my:Fields><br/>
<my:e1><xsl:value-of select ="my:e1"/></my:e1><br/>
<my:e2><xsl:value-of select ="my:e2"/></my:e2><br/>
<my:e3><xsl:value-of select ="my:e3"/></my:e3><br/>
<my:e4><xsl:value-of select ="my:e4"/></my:e4>
</my:Fields>
</xsl:template>
In this case output file element e2 always doesnt have artibute xsi:nil.
I want to change my xslt file to put atribute xsi:nil="true" in output file in e2 when element e2 is empty.
How to change xslt file to do this ?
<br/>
View the full article
i have two xml file:
first
<my:e1>42</my:e1><br/>
<my:e2 xsi:nil="true </my:e2><br/>
<my:e3>false</my:e3><br/>
<my:e4>EUR</my:e4>
second
<my:e1>43</my:e1><br/>
<my:e2>3</my:e2><br/>
<my:e3>false</my:e3><br/>
<my:e4>EUR</my:e4>
and XSLT file to convert
<xsl:template match ="my:Fields
<my:Fields><br/>
<my:e1><xsl:value-of select ="my:e1"/></my:e1><br/>
<my:e2><xsl:value-of select ="my:e2"/></my:e2><br/>
<my:e3><xsl:value-of select ="my:e3"/></my:e3><br/>
<my:e4><xsl:value-of select ="my:e4"/></my:e4>
</my:Fields>
</xsl:template>
In this case output file element e2 always doesnt have artibute xsi:nil.
I want to change my xslt file to put atribute xsi:nil="true" in output file in e2 when element e2 is empty.
How to change xslt file to do this ?
<br/>
View the full article