setContextNodeIdToAncestorMatchingStencil

Type: Transform step

Deprecated!

use setContextNodeIdToSelectionAncestor with XPath

Set the contextNodeId to the root element of the given stencil or null if we can't find the ancestor.

This transform is deprecated. Use inline XPath in operations instead.

Instead of:

JSON

"do-something": {
  "label": "Do Something(r)",
  "steps": [
    {
      "type": "transform/setContextNodeIdToSelectionAncestor",
      "data": {
        "selectionAncestorStencil": [
        	 "p",
        	 { "class": "matchingAncestor" }
        ]
      }
    },
    // (step that uses the contextNodeId)
  ]
}

Use:

JSON

"do-something": {
  "label": "Do Something(r)",
  "steps": [
    {
      "type": "(step that uses the contextNodeId",
      "data": {
        "contextNodeId": "x__fonto:selection-common-ancestor()/ancestor-or-self::p[@class='matchingAncestor'][1]"
      }
    }
  ]
}