Project

Profile

Help

"Effective boolean value is not defined..."

Added by Anonymous about 18 years ago

Legacy ID: #3580225 Legacy Poster: Barry Andrews (titanandrews)

Hello, I am having some more issues with upgrading Saxon from 6.5 to 8.6. I get this error message when running a transformation: "net.sf.saxon.trans.DynamicError Effective boolean value is not defined for a sequence starting with an atomic value other than a boolean, number, or string" I have no idea what this is talking about or even what line number the error is on so that I cannot figure out the problem. Does anyone have a clue? I would post the XSLT code but it is quite large and since I don't know where the error lies I cannot create a smaller test case. Any help is greatly appreciated! thanks, B


Replies (5)

Please register to reply

RE: "Effective boolean value is not defined.. - Added by Anonymous about 18 years ago

Legacy ID: #3580467 Legacy Poster: Michael Kay (mhkay)

You'll get this message if, for example, you do boolean((1,2,3)) or xsl:if test="current-date()" I can't think of any examples where you would get it from an unchanged XSLT 1.0 stylesheet, since the only types allowed there are numbers, strings, booleans, and node-sets, and these are all valid arguments to boolean() or other expressions that compute an effective boolean value. The absence of a line number obviously makes diagnostics difficult. I think it would be best if you send me the stylesheet and sample input, I will then investigate the problem - at the very least I need to fix the line number issue.

RE: "Effective boolean value is not defined.. - Added by Anonymous about 18 years ago

Legacy ID: #3580639 Legacy Poster: Barry Andrews (titanandrews)

Thanks Michael! Your comments helped me find the problem. I had this statement. <xsl:if test="$ProjectSummary"> <!-- Do something --> </xsl:if> The variable $ProjectSummary is an object reference. So basically I was testing to see if it was null. What made me think to do use this to check for a null reference in the 6.5 version, I do not know. I guess I just tried it, and it magically worked. But now it doesn't. My work around is to create a Java util method to make this check. Simple enough. Yeah, if you could give the line number on these types of errors, what would be very helpful. Thanks a lot! B

RE: &quot;Effective boolean value is not defined.. - Added by Anonymous about 18 years ago

Legacy ID: #3581632 Legacy Poster: Michael Kay (mhkay)

I haven't been able to reproduce the missing line number problem - it's more to do with the context in which the error occurred than the actual error itself. If you could send me the full stylesheet showing the problem, I'd br grateful. I don't need to run it, only to compile it. Michael Kay

RE: &quot;Effective boolean value is not defined.. - Added by Anonymous about 18 years ago

Legacy ID: #3581653 Legacy Poster: Michael Kay (mhkay)

In fact, the ability to convert an external object reference to a boolean is still mentioned in the documentation; it slipped away when the W3C spec changes were implemented that restricted the kinds of values that had an EBV defined. For the record, I decided I would re-introduce this capability. Michael Kay

RE: &quot;Effective boolean value is not defined.. - Added by Anonymous about 18 years ago

Legacy ID: #3582326 Legacy Poster: Barry Andrews (titanandrews)

It appears that the line number is coming after all. When I run the transformation from outside of our tools, I see the full error including line number. It looks like we have a bug in our code that is not giving us the full error trace. Thanks for re-introducing this functionality. I think it will be useful.

    (1-5/5)

    Please register to reply