ancestor with self not working for this task.
So I tried a workaround ( i am c++ guy)
Code:
<xsl:variable name="temp" select="boolean(false)"/>
<xsl:for-each select="ancestor::*">
<xsl:if test="boolean($temp) = boolean(true)">
<xsl:value-of select="concat(@name, '::')"/>
</xsl:if>
<xsl:if test="@name = 'tag3'">
<xsl:value-of select="$temp = boolean(true)"/>
</xsl:if>
</xsl:for-each>
but I dont know how to declare a variable .. that is $temp to set as false .. and when the loop reaches the tag3, I set it as true .. so from Tag4.. it will display the result I wanted ..
But my if condition failed.