|
|
| Suite :: Developer : Documentation | Technology | News |
 |
|
 |
 |
Customizing XML Structure - model.xml
Description: This file describes the contents of an XML structure definition file, model.xml.
Developer is preconfigured to work with DITA XML, but is also capable of operating with any user-defined XML structure. It can be configured for customized DITA XML or something completely unrelated, such as XML for invoice handling.
Currently, Developer does not support the direct use of a DTD or Schema file to control the structure of edited XML documents. This is related to the performance and size restrictions of browser-based applications. Instead, Developer uses an XML configuration file similar to a Schema, but it contains both the XML structure description and additional information, such as user-defined actions and presentation details.
Note: For step-by-step element creation/customization instructions see this section.
For your reference file DITAStorm/config/model.dtd contains a DTD definition of the structure of model.xml. |
 |
Reference: model
Description: Root element for the entire Developer XML structure definition.
Syntax
<!ELEMENT model (element*,editor*)>
Example:
<model> <element.../> ...
<editor.../> ... </model> |
 |
Reference: element
Description: Describes a single element in the set of all elements supported by the editor.
Syntax
<!ELEMENT element (group*,action*,default?)>
Properties
| Type |
Attribute Name |
Description |
| string |
name |
Name of the element. (E.g. 'section' or 'p') |
| string |
title |
Full name of the element (E.g.'Section' or 'Topic') |
| true | false |
addToNewButton |
Adds the element to the 'New' button in the editor allowing it to be the root element of the edited content. (E.g. for Topic) |
| string |
attributeeditor |
Name of the attribute that the editor associated with this element. See 'editor' element. (E.g. 'topic' or 'univ-atts'). |
| true | false |
confirmDelete |
Enables confirmation on deleting this element. Used primarily on high-level elements such as Section or Topic. |
| string |
doctypePublicId |
Will be used to generate a public ID for the element if it gets exported on the top level. (E.g. '-//OASIS//DTD DITA Topic//EN' for Topic). |
| string |
doctypeFile |
Used to generate a path to the file in the DOCTYPE section of the output XML document. This element should only contain a file name without the path. (E.g. 'topic.dtd' for DITA Topic). |
| true | false |
toolbarOnly |
Indication to only show the element on the Developer toolbar (E.g. for Bold or Italic). |
| string |
toolbarHTML |
Snippet to be used on the toolbar to render the element. Element will not be added to the toolbar if this attribute is not defined. (E.g. 'B' for bold). |
| true | false |
applyToSelection |
Indication to allow the element to be 'applied' to the selection. (E.g. set to true for Bold or Note). |
| character |
ctrlShortcut |
If defined, specifies keyboard key used with Control (Ctrl) key to insert element into the content. (E.g. by default set to 'b' on Bold and to 'i' on Italic element). |
| true | false |
enableUnwrap |
Enables 'unwrap' functionality when an element can be replaced by its content. (E.g. by default enabled for Note, Paragraph and Bold). |
| true | false |
inline |
A hint to the editor on how to better format the XML output. Inline elements flow with the text other (block) elements always represent rectangle. (E.g. inline elements are Bold and Quotes, block elements are Notes and Long Quotes). |
| true | false |
showPropsOnInsert |
Forces the editor to show the property dialog when an element is inserted (E.g. for XRef and Image DITA Elements). |
| true | false |
gnericRenderer |
Forces the editor to use 'generic' element rendered similar to the one in Outline mode. Setting this attribute to 'true' disables XSL styles defined for this element. |
| string |
helpUrl |
Location (URL) of the help page for this XML element. |
| true | false |
hidden |
Removes the element from the editor’s Insert menus, but does not prohibit it from creating or handling an element from an XML source or original XML document. |
| string |
lock |
Attribute defining editor-wide lock (or readonly) behavior for all elements of this type. See this section for more information and available values. |
Example:
<element name='topic' title='Topic' addToNewButton='true' attributeeditor='topic' doctypePublicId='-//OASIS//DTD DITA Topic//EN' doctypeFile='topic.dtd' confirmDelete='true'> <group allows='title' card='1'/> <group allows='shortdesc'/> <group allows='prolog'/> <group allows='body'/> <group allows='related-links'/> <group allows='topic,task,concept,reference' card='0..n'/> <default><![CDATA[<topic><title/><shortdesc/><body><p/></body></topic>]]>
</default> </element> |
 |
Reference: group
Description: Represents a group of child elements of enclosing element. Group elements are ordered and can not contain repetitive elements.
Syntax
<!ELEMENT group EMPTY>
Properties
| Type |
Attribute Name |
Description |
| string |
allows |
A comma-separated list of child elements allowed by this element. The order of the elements is not significant. The order of the groups is. One of the elements could be "#text", which indicates that the element could contain text. (E.g. for Title: '#text,b,u,i,tt,sup,sub...') |
| 0..1 | 0..n | 1 | 1..n |
card |
Cardinality of the elements in the group. 0..1 - group contains no element or one of the elements defined in 'allows' attribute. 1 - group contains only one element from the elements in the 'allows' attribute. |
| string |
emptyText |
Text displayed if an element contains no child elements. For example 'empty title' when contents of Title element is empty. |
| true | false |
preserveTextFormatting |
Indicates that text formatting needs to be preserved. (E.g. in 'pre' and 'code' DITA elements). |
Example:
Let’s take for example the following DTD definition of the Topic and how it is translated to model.xml
<!ELEMENT topic (title,body?,(topic|reference|concept|task)*)>
Here is the equivalent defined in model.xml:
<element name='topic' ...> <group allows='title' card='1'/> <group allows='body' card='0..1'/> <group allows='topic,reference,concept,task' card='0..n'/> </element>
|
 |
Reference: default
Description: Defines a fragment of XML that will be used to populate a newly created element. For example, for convenience UL should be created with inner LI.
Syntax
<!ELEMENT default (#PCDATA)>
Example:
<element ...> ... <default><![CDATA[<topic><title/><shortdesc/><body><p/></body></topic>]]>
</default> </element> |
 |
Reference: editor
Description: Describes element attributes and provides the editor with the necessary information to organize the editing process. Developer can reuse fields defined in other editors by using <fields.../> element.
Syntax
<!ELEMENT editor (fields|field)*>
Properties
| Type |
Attribute Name |
Description |
| string |
name |
Name of the attribute editor. |
Example:
<editor name="created"> <field attribute="date" title="Creation Date" type="date"/> ... </editor> |
 |
Reference: fields
Description: Imports fields defined in a different editor element with a specified name. This can be useful to organize commonly used attributes in groups for later reuse.
Syntax
<!ELEMENT fields EMPTY>
Properties
| Type |
Attribute Name |
Description |
| string |
name |
Name of the attribute editor to be included at this position. |
Example:
<editor name="xref"> <field attribute="href" title="Hyperlink URL" type="conref"/> ... <fields name="univ-atts"/> </editor> |
 |
Reference: field
Description: Defines a single attribute editing control. If the field is of the type 'choice' then 'option' child elements are available to define a list of possible attribute values.
Syntax
<!ELEMENT field (option*)>
Properties
| Type |
Attribute Name |
Description |
| string |
attribute |
Name of the attribute. (E.g: 'href') |
| string |
title |
Title of the attribute (E.g. 'Navigation Title' for 'navtitle' attribute). |
| 'string' | conref | choice | date | separator |
type |
Type of the attribute |
| number |
size |
Size of the attribute editing field (applicable for 'string' type) |
Example:
<editor...> <field attribute="href" title="Image URL" type="conref"/> <field attribute="alt" title="Alt Text" type="string"/> ... </editor> |
 |
Reference: option
Description: Describes one of the possible values of the attributes/fields defined with type 'choice'.
Syntax
<!ELEMENT option EMPTY>
Properties
| Type |
Attribute Name |
Description |
| string |
title |
Title of the dropdown value. |
| string |
attribute |
Actual attribute stored in the field. |
Example:
<field attribute="align" title="Alignment" type="choice"> <option title="" value=""/>
<option title="Left" value="left"/> <option title="Right" value="right"/> <option title="Center" value="center"/> </field>
|
|
|