Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] casting string as integer or double

From: Mario Madunic <hajduk@-------->
To:
Date: 5/1/2007 12:25:00 AM
I outputted the value of the @ and variable to another variable and in both
cases it contains a value. Then when I do the same but also add the called
template to the sequence and cast the variable or @ as xs:integer the process
fails and outputs the error message. I've now added a test if the @cols exists
and it runs in the first instance but not in the second. But after David
suggested using xs:integer(@cols) everything worked fine. Is there something you
were looking for in particular?

MM

Quoting Michael Kay <mike@xxxxxxxxxxxx>:

> > I'm using Saxon 8, and get the following error msg:
> > Fatal Error! An empty sequence is not allowed as the value in 
> > 'cast as' expression
> > 
> > I know that the value is not empty but a whole number.
> 
> Note that the two expressions
> 
> (a) $x cast as xs:integer
>        
> (b) xs:integer($x)
> 
> are almost synonyms, except that if $x is an empty sequence, (a) will fail
> with the error message you reported, while (b) will succeed, returning an
> empty sequence.
> 
> If the Saxon message says that the value is an empty sequence and you think
> it isn't, then you'll need to provide some evidence for your belief.
> 
> Michael Kay
> http://www.saxonica.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent