[xslt] Incomplete error message "Error Invalid type"



Title: Message
Hello,
when I tried to work with a result tree without using the node-set function, I noticed that in some circustances an incomplete error message is created which does not indicate where the error happened, but just the message text "Error Invalid type".
Please have a look the attached code snipped. When the now commented value-of call is executed, a "good" error message is created:
 
Error Invalid type
runtime error: file node-set-error.xslt line 16 element value-of
xsltValueOf: text copy failed
On the other hand, if the value-of is executed within the for-each loop as it is shown in the code, an incomplete error message just saying
 
Error Invalid type
is created. This makes debugging quite hard.
Thomas
 
--------------------------
 
<?xml version="1.0"?>
 
<xsl:transform
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0">
 
<xsl:output method="xml" indent="yes"/>
 
<xsl:template match="/">
 <xsl:variable name="record">
  <Record>
   <Value>10</Value>
  </Record>
 </xsl:variable>
 
<!-- Error message ok -->
<!-- <xsl:value-of select="$record/Value"/> -->
 
<!-- Bad error message -->
 <xsl:for-each select="$record/Value">
  <xsl:value-of select="."/>
 </xsl:for-each>
 
</xsl:template>
 
</xsl:transform>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]