Skip to main content

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โ€‹

defaultValue: string
delete: false
extract: string
matchBlanks: false
onSet: APPEND
selector: string
toField: string

Propertiesโ€‹

PropertyTypeRequiredDefault
defaultValuestringNo-
deletebooleanNofalse
extractstringNo-
matchBlanksbooleanNofalse
onSetenumNo-
selectorstringNo-
toFieldstringNo-

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โ€‹

  • APPEND
  • PREPEND
  • REPLACE
  • OPTIONAL

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.