List of articles   Colour designations   Choose language

How to refer to place of document,
which is not marked by author!?

Notation of XPath

Now it's impussible to refer to element (place of document), which has no attribute name, and no attribute id. I propose to specify necessary element in notation of XPath after name of document and marks "#:", and to name this specification as reader's label.

<a src="./a.htm#:html/body/p[187]/em[2]">           text </a>
<a src="./b.htm#:body/h2[5]">                       text </a>

Function 'contains'

Let '@@' means content of element except enclosed elements (got strings are merged; sequence of blanks, tabulation, new lines are considered as one blank); and mark '~' means function 'contains', in which arguments are rearrange, i.e. 'a~b' is equivalent to 'contains(b,a)'.

<a src="./a.htm#:html/body/h1[@@~"some thing"]+img[@src~"./pic.jpg"]"> text </a>
<a src="./b.htm#:dfn[@@~"stencil"]">                                   text </a>

Notation of CSS

Mark "plus" between two elements means the same as in CSS - that both elements are in the same level of hierarchy (i.e. they are enclosed into the same surroundting element), and that it's necessary to count number of element, located right mark "plus", not from beginning of contents of surrounding element - it's necessary to begin count after element, located left mark "plus".

<a src="./c.htm#:html/body/h3[4]+p[12]">            text </a>
<a src="./d.htm#:body/h1[3]+h2[2]+h3[5]+p[8]/b[3]"> text </a>

Browser searches first element html in first example, it searches first element body inside it, in which browser searches 4-th element h3 - reader's label refer to 12-th element p after it, enclosed in element body.

Browser searches first element body in second example, then browser continuously searches between elements, located inside it: 3-rd element h1; 2-nd element h2 after this h1; 5-th element h3 after this h2; 8-th element p after this h3 - reader's label refers to 3-th element b inside this paragraph.

Both notations simultaneously

<a href="./c.htm#:body/h2[@@~"part of header"]+h3[5]"> text </a>

Dmitry Turin

List of articles   Colour designations   Choose language