Re: [xml] XPath numbers and exponential notation

On Tue, Apr 24, 2001 at 07:04:34AM +0000, Bjorn Reese wrote:
Thomas Broyer wrote:
since April 21, libxml supports exponential notation of XPath numbers both
at parsing and writing (conversion to string). In the
xmlXPathStringEvalNumber comment was added a [30a] production, where does
it come from? I can't find anything on W3C's site.
Scientific notation is not allowed in XPath 1.0, but it has been added to
the requirements for XPath 2.0.

  Hum, the problem is that usually XPath extensions are cleanly isolated by
using namespaces. We should for sure document the change.
  Do other XPath implementations made this extension by augmenting the
number production or by using a namespaced function ?
I think the cleanest way is to:
   - at least raise a warning when a number don't follow the XPath production
     ideally still make this an error. Depends if existing stylesheets
     are written this way.
   - detect underflow or loss of numerical precision and provide a warning
     in this case too.
   - suggest to use a namespaced function doing the scientific notation
     translation to number:
     number xxx:number(string) 
     if there is others implementation of this functionnalities under
     different namespaces, then provide it under the existing ones.
  But it really depends on how other implementations did. I would prefer
a clean way but if others processors have extended the number production,
then we should accept their input. But we should not incitate people to
write stylesheet which are not proper per the standard.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

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