我正在开发一个 RSS 管理器,各种 RSS 提要将包含各种元素,有些可能不包含这些元素。我想实现一个 xsl:if 语句,如果提要中不存在元素,则不显示该元素。
例如:
<xsl:template match="item"> <!--an item in a feed-->
<xsl:value-of select="title" /> <!--display feed items title-->
<xsl:value-of select="author" /> <!--to display item's author BUT not all feed items have an author-->
我怎样才能使它不显示作者信息,除非该元素存在?