Editing NVDL schemas

When a complex XML document is composed by combining elements and attributes from different namespaces and the schemas which define these namespaces are not even developed in the same schema language then it is difficult to specify in the document all the schemas which must be taken into account for validation of the XML document or for offering content completion when the document is edited. In this case a NVDL (Namespace Validation Definition Language) schema can be used which allows to combine and interleave multiple schemas of different types (W3C XML Schema, RELAX NG schema, Schematron schema) in the same XML document.

<oXygen/> provides a special type of editor for NVDL schemas. This editor presents the usual text view of an XML document synchronized in real time with a graphical view of the schema components.

 NVDL schema diagram

 Introduction

<oXygen/> provides a simple, expressive and easy to read Schema Diagram View for NVDL schemas.

With this new feature you can easily develop complex schemas, print them on multiple pages or save them as JPEG, PNG and BMP images. It helps both schema authors in developing the schema and content authors that are using the schema to understand it.

<oXygen/> is the only XML Editor to provide a side by side source and diagram presentation and have them synchronized in real-time:

  • the changes you make in the Editor will immediately be visible in the Diagram (no background parsing).

  • changing the selected element in the diagram will select the underlaying code in the source editor.

 Full model view

When you create a new schema document or open an existing one the Editor Panel is divided in two sections: one containing the Schema Diagram and the second the source code. The Diagram View has two tabbed panes offering a Full Model View and a Logical Model View. The Logical Model View is not available for NVDL.

 

Figure 4.77. NVDL schema editor - full model view

NVDL schema editor - full model view

The Full Model View renders all the NVDL elements with intuitive icons. This coupled with the synchronization support makes the schema navigation easy.

Double click on any diagram component in order to edit its properties.

At the top of the diagram view there are buttons corresponding to the following actions:

Expand to references

This option controls how the schema diagram is automatically expanded. For instance if you select it and then edit a top level element or you make a refresh, the diagram will be expanded until it reaches referred components. If this is left unchecked, only the first level of the diagram is expanded, showing the top level elements.

For large schemas, the editor disables this option automatically.

Refresh

Refreshes the Schema Diagram according to the changes in your code (changes in your imported documents or those that are not reflected automatically in the compiled schema)

Show/Hide Annotations

Depending on its state (selected/not selected), the documentation nodes are shown or hidden.

Show/Hide Comments

Depending on its state (selected/not selected), the comment nodes are shown or hidden.

The contextual menu offers quick access to the Collapse children, Expand children, Print, Save as Image, Save Selection as Image and Refresh actions. The diagram can be saved as JPEG, PNG and BMP image.

If the schema is not valid you will see an error message in the Logical Model View instead of the diagram.

 Schema components view

The NVDL Schema Components View presents a list with the named or anonymous rules that appear in the diagram. It allows a quick access to a rule by knowing its name. It can be opened from PerspectiveShow ViewSchema Components

 

Figure 4.78. Schema components view for NVDL

Schema components view for NVDL