comparePositions

Type: Function

Deprecated!

Use XPath instead.

Compares the given positions w.r.t. document order in this state

Refer to blueprintQuery for more information on how to import and use this function.

Arguments

  1. blueprint

    (Required)

    Type: Blueprint

    The blueprint in which to consider the nodes

  2. parentNode1

    (Required)

    Type: Node

    The parent of the first position

  3. referenceNode1

    (Required)

    Type: Node | NULL

    The next sibling of the first position

  4. parentNode2

    (Required)

    Type: Node

    The parent of the second position

  5. referenceNode2

    (Required)

    Type: Node | NULL

    The next sibling of the second position

Returns

Type: Number

Returns 0 if the positions are equal, -1 if the first position precedes the second, and 1 otherwise.