我正在尝试做一个 XSL 选择来填充一个选择框。一旦我有这个工作,盒子里会有更多的选项,我只需要先让这个工作。它正在正确加载它只是没有拉 e:name 所以选项框正在呈现但没有选项是空白的。
这是我的 XSL
<xsl:template match="/">
<html>
<body>
<select id="epselect">
<xsl:element name="option">
<xsl:choose>
<xsl:when test="dalehoward/e:ep/@id = 1">
<xsl:value-of select="e:name"/>
<xsl:attribute name="value">1</xsl:attribute>
</xsl:when>
<xsl:otherwise>
EP not found
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</select>
</body>
</html>
</xsl:template>
这是我的 XML
<dalehoward xmlns:artist="http://www.beatport.com/artist/dale-howard/78784"
xmlns:e="http://www.beatport.com/artist/dale-howard/78784/releases"
xmlns:t="http://www.beatport.com/artist/dale-howard/78784/tracks">
<artist:bio>
<artist:profilepic>profilepic.jpg</artist:profilepic>
<artist:dob>16/10/1987</artist:dob>
<artist:pob>Liverpool</artist:pob>
<artist:about>
English Deep House producer, Dale Howard, first burst onto the scene in 2009 with his debut EP on Neurotraxx Deluxe 'Gotta Be Deep', which topped the Beatport Deep House chart reaching the Number 1 spot. Since then he has been making waves with an array of releases on world renowned labels like Fear Of Flying, Loco Records, Off Recordings and many others. Aswell as having countless top 20's and 50's Dale has also reached Number 2 and Number 3 on the Beatport Deep House Chart with his tracks 'Dropout' and '4 Hour Bang', which also stayed in the Top 10 for 9 weeks. 2012 brought more success and high acclaim for Dale, with his productions gaining huge support from artists like DJ Sneak, Luciano, Reboot, Dyed Soundorom, Steve Lawler, Dubfire, Magda, M.A.N.D.Y, Homework, Huxley, Jordan Peak, Dusky, Robert Owens, Michelle Owen and loads more, as well as even more releases scheduled with world renowned record labels.
</artist:about>
</artist:bio>
<e:ep id="1">
<e:name>Letters EP</e:name>
<e:year>2012</e:year>
<e:label>Static Audio</e:label>
<e:image>letters.jpg</e:image>
<t:track number="1" beatportrank="0">
<t:name>Letters</t:name>
<t:length>6.35</t:length>
<t:ytubelink>2H2XDQqvbpc</t:ytubelink>
</t:track>
<t:track number="2" beatportrank="0">
<t:name>Later</t:name>
<t:length>7.56</t:length>
<t:ytubelink>w61RrgBPahk</t:ytubelink>
</t:track>
<t:track number="3" beatportrank="0">
<t:name>'89 Flava</t:name>
<t:length>7:38</t:length>
<t:ytubelink>Mgarl-FlVhQ</t:ytubelink>
</t:track>
<t:track number="4" beatportrank="0">
<t:name>Safe Presentation</t:name>
<t:length>7.55</t:length>
<t:ytubelink>d_U38G9AwHk</t:ytubelink>
</t:track>
</e:ep>
</dalehoward>