[Xpath-ng] Proposal for definition of values/lists
Jeni Tennison
jeni at jenitennison.com
Tue Nov 26 07:10:50 MST 2002
Hi,
I propose that we define values in XPath NG as follows:
Every value in XPath NG is a list or an atom. A list is a sequence
of zero or more values. Atoms are of two kinds: nodes and data.
Nodes are atoms that have identity whereas data are atoms that do
not have identity.
[Issue: Should we have node sets instead of generic lists?]
[Issue: Should we allow only flattened lists rather than allowing
lists to hold lists?]
[Issue: Should we allow heterogeneous lists or only allow lists
whose items are all nodes, all atoms or all lists?]
[Issue: Are there better terms for "value", "list", "atom" and/or
"data"?]
There are three core types of data in XPath NG: strings, numbers and
booleans. These atoms can be cast to each other using the XPath 1.0
rules. The only difference is that in XPath NG, strings that hold
numbers in scientific notation can be cast to numbers, 'INF' is
converted to infinity and '-INF' is converted to negative infinity.
[Issue: Do we want another definition for numbers?]
[Issue: Should the string "false" cast to boolean false?]
Lists are cast to strings and numbers by converting the first value
in the list to a string or number; if the list is empty you get an
empty string or NaN. Lists are cast to boolean true if they contain
any values, boolean false if they do not.
[Issue: Should lists be converted to strings by concatenating the
string value of each value, with spaces as separators?]
Other modules may add more data types, but every data type must
define a mapping onto strings, numbers and booleans, and the module
must describe how that data type is created from a sequence.
[Issue: Do we need any more built-in data types?]
Any comments or thoughts on the above issues? Any other issues that
I've glided over?
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
More information about the Xpath-ng
mailing list