Re: [xml] XPath numbers and exponential notation
- From: Daniel Veillard <veillard redhat com>
- To: Bjorn Reese <breese mail1 stofanet dk>
- Cc: xml gnome org
- Subject: Re: [xml] XPath numbers and exponential notation
- Date: Tue, 24 Apr 2001 14:35:06 -0400
On Tue, Apr 24, 2001 at 05:58:23PM +0000, Bjorn Reese wrote:
Daniel Veillard wrote:
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.
I think this discussion is missing the important point. The XPath 1.0
standard is inadequate (and I regard the XPath 2.0 requirement to support
scientific notation as an acknowledgement of this) because it allows
garbage in the results. I do not expect any consistant behaviour from
other implemenations because of this.
Okay, let's look at it:
http://www.w3.org/TR/xpath20req#section-Requirements
4.2 Must Allow Scientific Notation for Numbers
---------------
XML Schema specifies a lexical representation for doubles and floats that
includes scientific notation as well as INF, -INF or NaN. XPath 2.0 MUST
support the lexical representations of floats and doubles supported by
XML Schema.
---------------
So basically this is a MUST, so yes it will change, and the way it's
formulated seems to imply that the Number production will actually change
but this part is unclear. It seems this is for input only, I don't know
what the XSL/Query WG are thinking in term of output...
Standard compliancy is definitely a good thing, but we should also keep
in mind that the W3C standards are created much faster than other standards
<grin/> being a chair of one W3C XML working group I tell you I don't think
this process is that fast, anyway ...
and thus more error-prone (the XSLT standard is another example of where
number formatting is inadequately described).
Okay is the lexical space we are accepting now the one defined by
XML Schemas ?
If people want a strictly XPath 1.0 conforming behaviour which allow
garbage in the results, I have no objections (you have to modify
xmlXPathStringEvalNumber, xmlXPathCompNumber, and xmlXPathFormatNumber
in order to do so), but I am perfectly happy with the current solution,
so I don't plan to make any such modifications myself.
Hum, for 1.0 I will have to compile a list of the deviations to the
spec. I note that there is at least one user report in favor of supporting
the scientific notation.
http://bugzilla.gnome.org/show_bug.cgi?id=53364
Maybe what I will have to do is put a "pedantic" flag to allow people
to catch deviations.
Hum, it's not fun to be on both side of the fence...
Daniel
--
Daniel Veillard | Red Hat Network http://redhat.com/products/network/
veillard redhat com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]