Tagless XML Authoring

Once the structure of an XML document and the required restrictions on its elements and their attributes are defined with an XML schema, the editing of the document becomes easier in a WYSIWYG-style editor in which the XML markup is not visible.

This type of tagless editor is available in Oxygen XML Editor as the Author mode. To enter this mode, click the Author button at the bottom of the editing area. The Author mode renders the content of the XML document visually, based on a CSS stylesheet associated with the document. Many of the actions and features available in Text mode are also available in Author mode.

Figure: Author Editing Mode

Associating a Stylesheet with an XML Document

The tagless rendering of an XML document in the Author mode is driven by a CSS stylesheet which conforms to the version 2.1 of the CSS specification from the W3C consortium. Some CSS 3 features, such as namespaces and custom extensions, of the CSS specification are also supported. Oxygen XML Editor also supports stylesheets coded with the LESS dynamic stylesheet language.

There are several methods for associating a stylesheet (CSS or LESS) with an XML document:
  1. Insert the xml-stylesheet processing instruction with the type attribute at the beginning of the XML document. If you do not want to alter your XML documents, you should set-up a document type.
    CSS example:
    <?xml-stylesheet type="text/css" href="test.css"?>
    LESS example:
    <?xml-stylesheet type="text/css" href="test.less"?> 
    Note: XHTML documents need a link element, with the href and type attributes in the head child element, as specified in the W3C CSS specification. XHTML example:
    <link href="/style/screen.css" rel="stylesheet" type="text/css"/>
  2. Configure a Document Type Association by adding a new CSS or LESS file in the settings. To do so, open the Preferences dialog box and go to Document Type Association. Edit the appropriate framework, open the Author tab, then the CSS tab. Press the New button to add a new CSS or LESS file.
    Note: The Document Type Associations are read-only, so you need to extend an existing one.

Selecting and Combining Multiple CSS Styles

Oxygen XML Editor provides a Styles drop-down list on the Author Styles toolbar that allows you to select one main (non-alternate) CSS style and multiple alternate CSS styles. An option in the preferences can be enabled to allow the alternate styles to behave like layers and be combined with the main CSS style. This makes it easy to change the look of the document.

An example of a common use case is when content authors want to use custom styling within a document. You can select a main CSS stylesheet that styles the whole document and then apply alternate styles, as layers, to specific parts of the document. In the subsequent figure, a DITA document has the Century style selected for the main CSS and the alternate styles Full width, Show table column specification, Hints, and Inline actions are combined for additive styling to specific parts of the document.
Note: Oxygen XML Editor comes with a set of predefined CSS layer stylesheets for DITA documents only, but the support is available for all other document types.
Tip: The Hints style displays tooltips throughout DITA documents that offer additional information to help you with the DITA structure. The Inline actions style displays possible elements that are allowed to be inserted at various locations throughout DITA documents.

Figure: Styles Drop-down List in a DITA Document

Author Mode User Roles

There are two main types of users of the Author mode: framework developers and content authors. A framework developer is a technical person with advanced XML knowledge who defines the framework for authoring XML documents in the tagless editor. Once the framework is created or edited by the developer, it is distributed as a deliverable component ready to plug into the application for the content authors. A content author does not need to have advanced knowledge about XML tags, operations such as validation of XML documents, or applying an XPath expression to an XML document. The content author just uses the framework set-up by the developer in the application and starts editing the content of XML documents without editing the XML tags directly.

The framework set-up by the developer is also called document type association and defines a type of XML document by specifying all the details needed for editing the content of XML documents in tagless mode.

The framework details that are created and customized by the developer include:

The tagless editor comes with some ready-to-use predefined document types for XML frameworks such as DocBook, DITA, TEI, and XHTML.

To watch our video demonstration about the basic functionality of the Author mode, go to http://oxygenxml.com/demo/WYSIWYG_XML_Editing.html.