The range-inside( ) Function
The range-inside( )
function takes as an argument an XPath expression
that returns a location set. For each location in this set, it
returns a range exactly covering the contents of that location. This
will be the same as the range returned by range( ) for anything except an element
node. For an element node, this range includes everything inside the
element, but not the element’s start-tag or end-tag. For example,
when applied to Example
11-1, xpointer(range-inside(//title)) returns a
range covering The Wonderful Wizard of Oz
but not <title>The Wonderful Wizard
of Oz</title>. For a comment, processing
instruction, attribute, text, or namespace node, this range covers
the string value of that node. For a range, this range is the range
itself. For a point, this range begins and ends with that
point.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access