0
<school>
<courses>
<course credits="3" courseNum="COMP2899" name="XML for Developers" url="http://www.bcit.ca/study/outlines/comp2899">
<prereqs>
<prereq courseNum="COMP1850"/>
</prereqs>
</course>
<course credits="3" courseNum="COMP1850" name="Introduction to Web Development and Design" url="http://www.bcit.ca/study/outlines/comp1850">
<prereqs>
<prereq courseNum="COMP1002"/>
</prereqs>
</course>
</courses>
</school>
XSL
<xsl:for-each select="./school/courses/course">
<xsl:sort select="./@courseNum" order="ascending" data-type="text"/>
<xsl:if test="./prereqs/prereq/@courseNum = COMP1850">
<tr>
<td><xsl:value-of select="@courseNum"/></td>
<td><a target="_blank" href="{key('courseKey', @courseNum)/@url}">
<xsl:value-of select="./@name"/></a></td>
</tr>
</xsl:if>
</xsl:for-each>
我想叫出courseNum, url and name
如果課程的prereqs courseNum
是COMP1850
但不知何故,我一直在嘗試一些東西或者它只是不做一件事或所有頁面變成空白。
所以基本上如果我的prereq元素的courseNum attr是COMP1850那麼我想調用course元素的attr值。
有人能請我幫忙嗎?謝謝
OMG THANKS!我討厭自己這樣做!我的天啊! – WXR 2014-12-05 06:15:55