setContextNodeIdToSelectionAncestorMatchingDitaClass

Type: Transform step

Deprecated!

This is deprecated.

Sets contextNodeId to the closest ancestor of the selection matching any of the given DITA class tokens.

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

Instead of:

JSON

"do-something": {
  "label": "Do Something",
   "steps": [
     {
       "type": "transform/setContextNodeIdToSelectionAncestorMatchingDitaClass",
       "data": {
         "parentDitaTypes": ["topic/p"]
       }
     },
     // (step using contextNodeId)
   ]
}

Use:

JSON

"do-something": {
  "label": "Do Something",
   "steps": [
     {
       "type": "(step using contextNodeId)",
       "data": {
         "contextNodeId": "x__fonto:selection-common-ancestor()/ancestor-or-self::*[fonto:dita-class(., 'topic/p')][1]"
       }
     }
   ]
}

Imported operation data

  1. contextNodeId

    Type: NodeId

  2. parentDitaTypes

    Type: Array<String> | String