Creates a new Locator representing the range between two Locators. The locators must share a common sourceUrl, otherwise null is returned.
Get the factory used by this instance for parsing selectors.
Parses the given data into a new Locator by:
ILocatorData
type.The ILocatorData is modeled after the "Resource" and "SpecificResource" types defined by the Web Annotations specification: https://www.w3.org/TR/annotation-model
Legacy Colibrio ILegacyAnnotationTarget
objects are not valid with the "External Web Resource" or "Specific Resource" types due to using "id" instead of
"source" while also specifying a "selector".
For backwards compatibility, these object can still be used with this method. If the ILegacyAnnotationTarget
does not have an "id", you must provide a baseUrl.
NOTE: JSON-LD processing is NOT supported. Ensure that the data passed to this method is compatible with the
IWebAnnotationResourceData
or IWebAnnotationSpecificResourceData
type.
NOTE: Specifying both the 'selector' property AND a fragment part in 'source' is strongly discouraged as this behaviour is not fully defined in the Web Annotations spec. Colibrio's behavior is to treat 'selector' as refinement selectors on the fragment selector.
Selectors that cannot be parsed by the selector factory will be dropped.
The data to parse into a Locator.
The base URL to use if data
is a relative URL, otherwise this parameter is unused.
An object with a new Locator instance or the error that caused the parse to fail.
Generated using TypeDoc
Used for parsing Locators and for creating Locator ranges.