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.