给出此xml
<some>
<where>
<in>
<hell></hell>
</in>
</where>
</some>
和此xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" />
<xsl:template match="in">
this is a <xsl:value-of select="name()"/>
this is a <xsl:value-of select="ancestor::where/name()"/>
</xsl:template>
</xsl:stylesheet>
of的第一个值返回“ in”,第二个是语法错误。我本来希望看到“ where”,但是我无法在这里开始理解语法。
规范在线,因此如果您想了解有关XPath 1(XSLT 1中使用的表达语言)的规则的更多信息,请查阅https://www.w3.org/TR/xpath-10/。>