-1
我有一些XML標記,看起來像以下:XSLT選擇屬性
<Conf_Standings League="Atlantic Coast">
<Listing>
<Team>Syracuse</Team>
<TeamID>C76</TeamID>
<Record Type="Conference">
<Wins>10</Wins>
<Loss>0</Loss>
<Win_Percentage>1.000</Win_Percentage>
</Record>
<Record Type="Overall">
<Wins>23</Wins>
<Loss>0</Loss>
<Win_Percentage>1.000</Win_Percentage>
</Record>
</Listing>
<Listing>
<Team>Virginia</Team>
<TeamID>D05</TeamID>
<Record Type="Conference">
<Wins>10</Wins>
<Loss>1</Loss>
<Win_Percentage>.909</Win_Percentage>
</Record>
<Record Type="Overall">
<Wins>19</Wins>
<Loss>5</Loss>
<Win_Percentage>.792</Win_Percentage>
</Record>
</Listing>
</Conf_Standings>
當我通過使用XSLT 1.0的上市循環中,我使用類似以下內容:
<xsl:for-each select="Conf_Standings/Listing">
的我現在遇到的問題是,在這一點上,我目前在每個人的背景下Listing
,並且不能再參考Conf_Standings
中的League
屬性。如果我嘗試做一些事情,如:
"standings": [<xsl:for-each select="Conf_Standings/Listing">
{
"name": "<xsl:value-of select="normalize-space(@League)"/>"
}
...
聯賽的名字是空的。什麼是搶的@League
在我的例子保持上述的正確方法,使「大西洋海岸」一旦我的Conf_Standings/Listing