You could just see if the node exists in the xml. Only published content is accessible.
Something like (not tested)
<xsl:choose>
<xsl:when test="//descendant::node [@id = £youridvariable]">
//Do your node stuff here
</xsl:when>
<xsl:otherwise>
//Node does not exist
</xsl:otherwise>
</xsl:choose>
You could perhaps do a check on a value of the node whilst casting it to a string, then test if the string is empty. You could also do it for-each for nodes matching the ID and the loop won't be entered if there isn't a published node matching that ID.
How to get publish status in xslt?
Hi all,
Is it possible to know the specified node published or not in xslt?
i'm showing some details by direclty giving the node id in xslt. so if the admin unpublish the node its giving error in the xslt.
How can i resolve this issue? any help is appriciated.
You could just see if the node exists in the xml. Only published content is accessible.
Something like (not tested)
Hi there
You could perhaps do a check on a value of the node whilst casting it to a string, then test if the string is empty. You could also do it for-each for nodes matching the ID and the loop won't be entered if there isn't a published node matching that ID.
Hope this helps,
Dan
is working on a reply...