Can func:function return a xsl:message with nodes inside the xsl:message?

Christine Li <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>



Hello,

Could someone help me to verify the right results of the func:function? I
have following code, currently it doesn't work with Xalan. It throws error
that says "misplace literal result in a func:function container"

<func:function name="my:test">
  <xsl:param name="type"/>
  <xsl:choose>
  <xsl:when test="$type='B'">
    <func:result select="2"/>
  </xsl:when>
  <xsl:otherwise>
    <xsl:message>
      Error
    </xsl:message>
  </xsl:otherwise>
  </xsl:choose>
</func:function>

<xsl:template match="foo">
  <xsl:value-of select="my:test(@Name)"/>
</xsl:template>

According to the spec., it mentions "it is an error if the instantiation of
the template results in the generation of result nodes.". How should I
interpret this spec.? Does it works for
nodes generated within xsl:message? I know it works for nodes generated
inside
xsl:variable. e.g.

<xsl:otherwise>
  <xsl:variable name="x">
     <new-node/>
  </xsl:variable>
<xsl:otherwise/>

Thanks,

Christine Li
XSLT Development
IBM Toronto Lab
Tel: (905)413-2601
Email: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.