Validate id attribute in XSLT



In my request have around 500 child elements and those elements have attribute id, id is optional element. I have used bellow code snip to convert my request id attribute.



<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id" />
</xsl:attribute>
</xsl:if>


Is there any way to do the <xsl:if test="@id"> validation in common place that affected to all the places. Otherwise I have to check this in every places.


Please advice me. Than you...


No comments:

Post a Comment