DomOperation
A single DOM extraction or deletion operation for the DomTransformer.
Notes
Defines a single DOM extraction or deletion operation for the DomTransformer. Specifies a CSS/jQuery-style selector, the element attribute or content to extract, the target metadata field, and optional behavior for blank values and default values when no match is found.
Usage
- YAML
- JSON
- XML
defaultValue: string
delete: false
extract: string
matchBlanks: false
onSet: APPEND
selector: string
toField: string
{
"defaultValue": "string",
"delete": false,
"extract": "string",
"matchBlanks": false,
"onSet": "APPEND",
"selector": "string",
"toField": "string"
}
<domOperation>
<defaultValue>string</defaultValue>
<delete>false</delete>
<extract>string</extract>
<matchBlanks>false</matchBlanks>
<onSet>APPEND</onSet>
<selector>string</selector>
<toField>string</toField>
</domOperation>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
defaultValue | string | No | - |
delete | boolean | No | false |
extract | string | No | - |
matchBlanks | boolean | No | false |
onSet | enum | No | - |
selector | string | No | - |
toField | string | No | - |
Property Details
defaultValue
Value stored in toField when the selector matches nothing. Without it, no field is created for documents where the selector finds nothing. Not applicable when delete is true.
delete
Whether to delete the matching elements from the document instead of extracting them. Default is false. When true, toField, defaultValue and extract do not apply — the operation removes markup rather than reading it.
extract
Specifies what to extract from the matched DOM element (e.g., text, html, outerHtml, ownText, data, id, tagName, val, className, cssSelector, or attr(attributeKey)).
matchBlanks
Whether an element with a blank value counts as a match, storing an empty string. Default is false, which treats blank elements as no match at all.
onSet
Defines what to do when the target field already has one or more values. When unspecified, new values are appended to existing ones by default.
Allowed Values
APPENDPREPENDREPLACEOPTIONAL
selector
A CSS or jQuery-like selector expression identifying which DOM elements to target.
toField
The target metadata field name where the extracted or computed value will be stored. If a field of the same name already exists, the behavior is controlled by onSet.