I want to check the parent of current node is root node or not in Xslt.How i do that? Please Guide me to get out of this issue...
Thanks & Regards, P.SARAVANAN
You can use not(ancestor::*)
.
Usage Example:
<xsl:template match="node()|@*">
<xsl:if test="not(ancestor::*)">
<xsl:message>The root element is "<xsl:value-of select="name()"/>".</xsl:message>
</xsl:if>
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>