[Xpath-ng] Positional predicates (WAS: Minimal FIXPath (with a bonus)?)

David Carlisle davidc at nag.co.uk
Thu Jan 9 07:10:45 MST 2003


  (a) we'd have to specify in mind-numbing detail exactly what is and
      isn't known statically or

Hmm now where have I seen a document like that recently....


  (b) we'd end up with different implementations doing different
      things depending on how good their static type checking was

I'm never in favour of implementation defined features.


  by saying that the predicate is only interpreted as being positional
  if it either contains a numeric literal or a call to the function
  last()

Yes this is a variation on a theme, but if you include last() why not
count() and if you include both those you end up with having to say why
not other numeric valued functions. Probably I'd go for just numeric
literals if the static information isn't going to be in the final spec.


Whether or not such an incompatible change is acceptable depends a bit
on what happens in the other cases, which depends on what the rules for
coercing between types end up being.

If [last()] isn't going to mean [position()=last()] then it would be
best if it would error rather than coerce to a boolean (presumably
boolean true as non zero). I'm not sure that that would be possible
though in any compatible way given Xpath1's preference for coercing
anything to something useful rather than give an error.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Xpath-ng mailing list