Inmedius® DITA™ Chat | Subscribe | Email | Contact Us | Inmedius
Next Steps
Download Data Sheet
View Flash Demos
Access Online Editor
Test Drive Software
Buy It Now
Suite :: Developer : Documentation | Technology | News
Basic Editing  :  Integration  :  Customization  :  XSL Support
       :  Extension Points
       :  Custom XML Elements
       :  model.xml
       :  Read-Only Elements

Read-Only (Locked) Elements


Description: This section describes the actions necessary to disable the editing of certain XML elements and attributes within Developer.

Making Elements Read-Only


There are three scenarios when an XML editor may need to prevent users from modifying certain elements of XML:

  • Prevent editing of a certain attribute
  • Prevent an element from being removed from its parent
  • Prevent editing of an element and all child nodes contained in it

All three scenarios could be enforced for a certain class of elements, (see lock attribute in model.xml) as well as for specific elements within the provided XML.

To enforce one of these rules on specific elements within XML, the developer uses the special _lock attribute. Its value will identify how the element should be handled. List of available values:

_lock attribute value Description
attribute:<attribute_name>

Prohibits editing of the specified attribute. For example:

<section product="UV Scanner"
  _lock="attribute:product">
  ...
</section>

content

Prohibits editing of an element along with attributes and child nodes. For example:

<section _lock="content">
  ...
</section>

inparent

Prevents any action that could remove the element from its parent. For example:

<section _lock="inparent">
  ...
</section>

any combination of values above

Combines the effect of multiple settings. Values should be coma or space separated. For example:

<section
  _lock="inparent,attribute:product">
  ...
</section>

Restriction: At the moment, the editor only enforces the read-only policy for WYSIWYG and Outline editing modes. Using the raw XML editing mode, users can overwrite read-only customizations. This issue will be addressed in future versions of the editor.

CSS Styling for Read-only Elements


To indicate that a certain element and all of its child nodes can not be edited, Developer uses CSS style called readonly. In the initial configuration the background is light gray and letters are dark gray and italic:

.readonly {
background-color: #F5F5F5;
color: #A0A0A0;
font-style: italic;
}

User can customize styling by updating the definition in the CSS file styles.css located in the Developer directory.

Site Map Privacy Statement | Terms of Use
©2005-2008 Inmedius, Inc. All rights reserved. | DITA Links: