The Document Readers
The
GoldenGATE editor uses Document Readers for loading documents. In marked-up data,
they can filter and rename tags, and decide if a tag will be represented as a
Document Part or as a plain Annotation.
The Document Readers Menu
The Document Readers menu is part of the Window
menu in the GoldenGATE main window. It contains the functions for creating and
managing Document Readers:
- Create: Create a new Document
Reader.
- Edit: Open the Document Reader editor
dialog.
The Edit Document Readers Dialog
The dialog for Document Reader management is
accessible through the Edit function in the Document Reader menu. On the right
of the dialog, a list displays all existing Document Readers. In the middle, it
displays the configuration of the Document Reader currently selected in that list,
which consists of four parts.:
- Paragraph Tags: This list defines which tags should be considered paragraph-like structures, i.e. at the end of which tags the text should have a line break. In case of a Document Reader for HTML, this list might contain "tr", for instance, in order to have line breaks at the end of what originally was a table
row.
- Ignore Tags: A list of tag names to be filtered out. In case of a Document Reader for HTML, this list might contain "font", "b", etc., for instance, in order to remove layout information, which might not be a desired part of the resulting
document.
- Tag Mappings: The tag mapping table provides a list of renamings, where the element name in the "Mapped Tag" column is renamed to the element name in the "Mapping Target" column. In case of a Document Reader for HTML, this list might map "p" to "paragraph", for instance, in order to unify the element names of paragraphs. In addition to the table, the tab provides two buttons for managing the mappings, and a
checkbox:
- Add Mapping: Add a new mapping to the table. This will prompt for a "Mapped Tag", the "Mapping Target" can be entered in the table afterward.
- Remove Mapping: Remove the mapping currently selected in the table.
- Use HTML Parse Style: Checking this box switches parsing to a rather tolerant, error correcting mode, which is eligible for third party web content, unchecking it switches to a restrictive parsing style that requires well-formed XML.
- Document Part Tags: This list defines which tags will be represented as Document Parts instead of plain Annotations. In case of a Document Reader for HTML, this list might contain "p", for instance, in order to make paragraphs editable units of their
own.
- File Types: This list defines the file types (file name extensions in the file system) GoldenGATE should apply this particular Document Reader to. In case of a Document Reader for HTML, this list might contain "html" and "htm", for instance. Attention: Since there can be only one default Document Reader for each file type, adding a new file type to a Document Reader might change the document loading behavior of the GoldenGATE editor. In order to directly choose which Document Reader to apply for reading a particular file, check the "Use Custom Document Reader" box in the Load Document dialog.
At
the top of the dialog, a line of buttons provides the functionality for managing
the Document Reader:
- Create: Open
a sub-dialog for creating a new Document Reader.
- Clone: Clone
the Document Reader currently selected. This is pretty much the same as
creating a new one, beside the fact that the parameters of the cloned one
are copied.
- Delete: Delete
the Document Reader currently selected.