Re: [web-annotation] XPath Range Selector

I don't think it detracts from my point, though, which was to show how
 using TextQuoteSelector (or any other selector) for each boundary 
point may be a useful, semantic way to describe a range in some use 
cases.

To summarize my feelings about the current proposal for XPathSelector:

- It is adequate for describing a DOM Range that starts and ends at a 
node boundary.

The last path component would be `/node()[x]` where `x` is the context
 position for the boundary offset.

- It is less obviously good for describing a DOM Range that starts or 
ends inside a text node.

Since the closest correct expression would evaluate to a string and 
what is needed is the Node context an implementation for DOM would 
need to tokenize the XPath expression into a context part and a string
 offset part. The former could be evaluated with `document.evaluate` 
and the latter parsed to determine the offsets. I think using XPath to
 select a node and using subSelector to select its character data 
would be easier on implementors.

- I can see the utility for a range that uses other kinds of selectors
 for its boundaries.

I feel as though it would be useful for other media types, too, but 
not sure how to feel about the resulting overlap with other selectors 
that already describe ranges for certain media types like 
TextPositionSelector and DataPositionSelector.

-- 
GitHub Notif of comment by tilgovi
See 
https://github.com/w3c/web-annotation/issues/95#issuecomment-155552457

Received on Tuesday, 10 November 2015 20:13:29 UTC