从xslt获取值

时间:2013-06-17 09:23:04

标签: xml xslt xslt-1.0

我有像prd.xml这样的xml

  <product>
<text>Some Text</text>
    <name>Pname</name>
    <category extra="category"> Test</category>
    </product>

我想使用xslt从xml中获取类别。

我试过

<xsl:variable name="p" select="prd.xml"/>

<xsl:value-of select ="$p/product/category"/>

但我无法得到结果。任何人都可以帮忙解决问题吗?

1 个答案:

答案 0 :(得分:1)

 select="prd.xml"

选择一个不存在的元素prd.xml,你想要

select="document('prd.xml')"