0
我的XML文件的代碼如下:XSL錨屬性
<?xml version="1.0" encoding="utf-8"?>
<testimonials>
<item>
<author-name>xyz</author-name>
<author-url>http://xyz.net</author-url>
</item>
<item>
<author-name>abcde</author-name>
<author-url>http://abc.org</author-url>
</item>
</testimonials>
XSL文件的代碼看起來
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" indent="no"/>
<xsl:template match="/xmlfile">
<xsl:for-each select="item">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="author-url"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
<xsl:value-of select="author-url"/>
</a>
</li>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
當我嘗試使用這些XML文件,我沒有得到錨標籤,我根本看不到文本輸出
XYZ http://xyz.net ABCDE http://abc.org
PL緩解讓我知道,如果我做任何chnages使我能看到的錨標記
謝謝你,它的工作了。 – ashu09