[
Lists Home 
Date Index 
Thread Index
]
> I think confusion has come in due to an inconsistency between
> the notion of
> a nodeset being unordered, and the fact that XSLT can
> process nodesets as if they are ordered.
>
> This seems odd that XSLT can treat nodesets as if they are
> ordered, even though they are not.
Yes, people get very confused by this: I've even seen some trained
mathematicians get confused by it.
The key point is that the ordering is a property of the nodes, not of the
collection. If you have three nodes N1, N2, and N3, you can only define one
nodeset containing these nodes, just as you can only define one set
containing the integers (1, 2, 3). But it's perfectly reasonable to define a
function that operates on setsofintegers whose effect is to list the
integers in numeric order, and it's equally reasonable to define a function
that operates on setsofnodes whose effect is to apply templates to them in
document order.
The existence of an ordering (or of several orderings!) over a domain
doesn't stop you defining sets of objects from that domain.
Of course, it's all going to change in XPath 2.0, so this debate will soon
be history.
Mike Kay
