【发布时间】:2009-11-24 21:33:51
【问题描述】:
我开始使用 XSLT 并编写此 scipt:
<?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
我需要获取链接列表,但我得到了整个页面的输出。怎么了?我怎样才能让它工作?
【问题讨论】: