varuog
varuog

Reputation: 3081

Detect param type xslt

detect if <xsl:with-param> calls with select attribute or using text node of the <xsl:with-param>. In other words how to detect parameter type if it is string or xpath notation of node?

Upvotes: 2

Views: 287

Answers (2)

Michael Kay
Michael Kay

Reputation: 163595

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.

Upvotes: 3

G. Ken Holman
G. Ken Holman

Reputation: 4403

In XSLT 2.0 you can use the instance of operator:

<xsl:if test="$p instance of xsd:string">

Upvotes: 2

Related Questions