W3C home > Mailing lists > Public > public-annotation@w3.org > November 2015

Re: [web-annotation] XPath Range Selector

From: BigBlueHat via GitHub <sysbot+gh@w3.org>
Date: Fri, 06 Nov 2015 19:04:11 +0000
To: public-annotation@w3.org
Message-ID: <issue_comment.created-154502565-1446836650-sysbot+gh@w3.org>
@tilgovi so...something like:

```
{
  "selector": {
    "type": "Range",
    "startSelector": {
      "type": "XPathSelector",
      "path": "//article/p[1]"
      "subSelector": {
        "type": "TextPositionSelector",
        "start": 10,
        "end": 10
      }
    },
   "endSelector": {
      "type": "XPathSelector",
      "path": "//article/p[3]"
      "subSelector": {
        "type": "TextPositionSelector",
        "start": 0,
        "end": 8
      }
    }
  }
}
```

That seems to actually specify a node and a *point* within it and 
another node and a *range* within it.

Personally, I found this construction to make more sense
```
 {
  "selector": {
    "type": "XPathSelector",
    "startPath": "//article/p[1]",
    "endPath": "//article/p[3]",
    "subSelector": {
      "type": "TextPositionSelector",
      "start": 10,
      "end": ...whatever the end # would be within the normalized 
output of the text between p[1] & p[3]...
    }
  }
}
```

Obviously things fall down (currently) for the value of `end` in the 
`TextPositionSelector`...but that seems definable.

Do those examples present both sides accurately? In either case, what 
am I missing (which I'm sure is something :smile: )?

-- 
GitHub Notif of comment by BigBlueHat
See 
https://github.com/w3c/web-annotation/issues/95#issuecomment-154502565
Received on Friday, 6 November 2015 19:04:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:54:42 UTC