1
我使用XSLT和写这个素文字首发:使用XSLT的XHTML链接提取
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8" />
<xsl:template match="span[@class='thumb']" >
Link: <xsl:value-of select="$base" /><xsl:value-of select="a/@href" />
</xsl:template>
<xsl:template match="/">
Base href: <xsl:value-of select="$base" />
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
并使用此命令:
xsltproc --html --param base "'http://example.com'" lista.xslt test.html
我需要获得链接的名单,但我得到输出整个页面。怎么了?我怎样才能得到它的作品?