2

检测<xsl:with-param>调用是否带有select属性或使用<xsl:with-param>. 换句话说,如果它是节点的字符串或 xpath 表示法,如何检测参数类型?

4

2 回答 2

3

There is no reliable way in XSLT 1.0 of determining what type of argument has been passed. You need to design the interface differently so as to remove this requirement, e.g. by passing an extra parameter.

于 2013-07-27T08:24:04.783 回答
2

在 XSLT 2.0 中,您可以使用instance of运算符:

<xsl:if test="$p instance of xsd:string">
于 2013-07-27T02:19:28.280 回答