[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why does my XSLT produce a Warning message with n
On Sun, 2024-03-31 at 07:57 +0000, Roger L Costello costello@xxxxxxxxx wrote: > > How can the XSLT code be written so that, when executed, it doesn't > produce a Warning message?B You may find that reversing the sense of the test gts rid of the warning - if (normalize-space($test) ne '') then xs:integer($test) div 10 else () The XPath spec says that dynamic errors must not be raised from the if/else branch not taken. This is a warning, not an error, but since the spec explicitly allows this use of if/else, it seems like an inappropriate warning to me. But it's a judgement call. A better way to write this, though, might be if (normalize-space($text) castable as xs:integer) then xs:intefer(normalize-space($test)) div 10 else () liam -- Liam Quin,B https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|