匹配两段ID我想匹配的blogcategory PARENTID与父母ID .. 这里是我的代码:IF在XSLT语句中BlogCategories
<?xml version="1.0" encoding="utf-8"?>
<BlogCategories>
<BlogCategory ID="1" ParentID="0" Name="Travel" Active="1" seo_keywords="Travel Blogs" seo_description="Travel Blogs" ParentName=""/>
<BlogCategory ID="13" ParentID="1" Name="Destinations" Active="1" seo_keywords="Destinations" seo_description="Destinations" ParentName="Travel"/>
<Parent Id="1" ParentName="Travel"/>
<Parent Id="2" ParentName="HealthCare"/>
</BlogCategories>
这是我的.xslt页:
<xsl:for-each select="Parent">
<div class="grid-row3">
<ul>
<a href="">
<xsl:value-of select="@ParentName"></xsl:value-of>
</a>
<xsl:for-each select="/BlogCategories/BlogCategory">
<xsl:if test="@[email protected]">
<li>
<a href="">
<xsl:value-of select="@Name"></xsl:value-of>
</a>
</li>
</xsl:if>
</xsl:for-each>
</ul>
</div>
</xsl:for-each>
的问题是,块的类(的PARENTID <BlogCategory ID="1" ParentID="0" Name="Travel" Active="1" seo_keywords="Travel Blogs" seo_description="Travel Blogs" ParentName=""/>)
不匹配父(<Parent Id="1" ParentName="Travel"/>
)
即ID如果我手动执行<xsl:if test="@ParentID=1">
那么如果我做同样的事情会work..but ..then的问题是在这里:<xsl:if test="@[email protected]">
我如何匹配@[email protected]