Рисунок 2

Таблица

 

Ancestor(ancestors_number)

=

+   ;

Ancestor-or-self(ancestors_number)

=

+   ;

Attribute(ancestors_number)

=

max(ancestors_number - 1; 0)   ;

Child(ancestors_number)

=

max(ancestors_number - 1; 0)   ;

Descendant(ancestors_number)

=

max(ancestors_number - 1; 0)   ;

Descendant-or-self(ancestors_number)

=

ancestors_number   ;

Following(ancestors_number)

=

+   ;

Following-sibling(ancestors_number)

=

max(ancestors_number; 1)   ;

Namespace(ancestors_number)

=

max(ancestors_number - 1; 0)   ;

Parent(ancestors_number)

=

ancestors_number + 1   ;

Preceding(ancestors_number)

=

+   ;

Preceding-sibling(ancestors_number)

=

max(ancestors_number; 1)   ;

Self(ancestors_number)

=

ancestors_number   .