Content Aggregation with XML Entities and XPath

Interaction builds HTML pages by aggregating content from different sources. It can include files or fetch resources from other websites and databases for integration with your sites.

Including Files

It is easy to include a file using Interaction. Just choose the file in a dialog and insert an XML standard entity reference wherever you want to embed the content. Interaction takes care of the rest. Optionally specify an XPath to extract only parts of the content for insertion. The following dialog configures an entity to include the log file of Interaction so that it can be made available via a web browser:

Fetching External Resources

Resource Entities facilitate inlining content from other websites. You specify the URL of the page in a dialog. Interaction fetches the document using a web request just as if it was a browser. The content is processed by Interaction to benefit from visitor tracking, style sheets and other server-side features provided by the application. Here is an example of a resource entity that fetches selected content from our website:

You can configure a resource entity to submit arguments with the HTTP requests. Default values for the arguments merges with form fields submitted by the visitor. This provides a generalized mechanism to integrate web enabled databases such as FileMaker, 4D or Oracle with Interaction.

Extracting Selected Parts

The optional Selection in the dialog above is an XPath that tells what part of the content to extract as value. XPath is the W3C specification for addressing subsets of markup content. An XPath can select parts of any XML, Extensible HTML or conventional HTML content available on the Internet. The XPath in the dialog above extracts the text content of the top level header (h1) of the chosen page.

Sharing Entities

Interaction supports global XML entities, so that you can share units of information between many documents. An entity can be embedded anywhere in documents using an XML standard entity reference. The same entity can be included many places, meaning that you can use them to eliminate redundant content and make it easier to maintain the information of your sites.

Entities can be shared between websites. The other aliased entities can be located on any Interaction site on the web. Thus, a site can syndicate entities that are aggregated by other Interaction sites. The following alias entity provides the message-of-the-day from our website:

Just as resource entities, entity aliases can have an optional XPath to extract selected fragments of the content.

Aggregating with Scripts

No scripting is necessary to use Interaction, but if you know how to do it, you can write scripts that aggregate content from different sources. Scripts gives you the most flexibility in processing and using the aggregated information. You can for example use Interaction's implementations of the W3C DOM API in scripts to navigate or extract sections of the content.