xslt - Test for result tree fragment -


i'm trying create template either presents content, or inserts placeholder indicate absence of content:

<xsl:template name="information">     <xsl:param name="content">     <xsl:choose>         <xsl:when test="$content">             <content>                 <xsl:apply-templates select="$content/node()" />             </content>         </xsl:when>         <xsl:otherwise>             <placeholder/>         </xsl:otherwise>     </xsl:choose> </xsl:template> 

this works well, until content result tree fragment:

<xsl:call-template name="information">     <xsl:with-param name="content">yes</content> </xsl:call-template> 

i'm using microsoft .net xslt engine, can call msxsl:node-set() on parameter obtain workable node-set, don't know how test if parameter needs treatment. far lesser case content generated.

is there way make template work proper node-sets and result tree fragments?

xslcompiledtransform in .net 2.0 , later supports exsl:object-type http://exslt.org/exsl/functions/object-type/index.html can check type of variable if needed. on other hand don't think there problem in calling msxsl:node-set on node set instead of result tree fragment, returns node set unchanged.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

c# - MSDN OneNote Api: Navigate to never before opened page without opening a OneNote Application Window -