Connector Framework Server 12.11

# Extract Metadata

This section demonstrates how to extract metadata from an HTML page and add it to a document field.

Consider the following HTML:

    <h1>This is a title</h1>
    <h2>This is a sub-title</h2>
    <p class="important">This is <strong>important</strong> text</p>

From this HTML you could extract all of the headings and add them to a metadata field named `heading`. You could also extract the important text and add that to a separate document field.

The configuration parameters `MetadataSelector` and `MetadataFieldName` select the information to extract and provide the name of the destination document field. These parameters must be set in numbered pairs (so that each `MetadataSelector` parameter has a matching `MetadataFieldName`). The `MetadataSelector` parameter accepts standard CSS2 selectors.

The following configuration would extract the information described above:

    MetadataSelector0=h1,h2,h3
    MetadataFieldName0=heading
    MetadataSelector1=p.important
    MetadataFieldName1=important_paragraph
    MetadataSelectorExtractPlainText=TRUE

The parameter `MetadataSelectorExtractPlainText` specifies whether to extract as plain text (removing HTML markup, for example).

The configuration above would produce the following metadata fields:

    #DREFIELD heading="This is a title"
    #DREFIELD heading="This is a sub-title"
    #DREFIELD important_paragraph="This is important text"

© Copyright 2022 Micro Focus or one of its affiliates
Version 12.11 | Last updated February 2022

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL Connector Framework Server 12.11

Topic Title: Extract Metadata