Develop > Application Configuration > Manage XML configuration files > Customize XML DTD element display

Customize XML DTD element display

There are two optional settings you can add to your XML-DTD configuration template that allow you to customize how elements from the target XML-DTD configuration file are displayed in the value set editor in the SA Client. The ACM-PRINTABLE and ACM-DESCRIPTION optional settings allow you to control the names of elements as they appear in the SA Client:

  • ACM-PRINTABLE: Defines the label for each element from the XML file that is displayed in the value set editor when the XML-DTD template is shown in the SA Client.
  • ACM-DESCRIPTION: Defines mouse-over text when a user moves a mouse pointer over the field defined in ACM-PRINTABLE in the value set editor in the SA Client.

Explicit versus positional display settings

You can set the printable and description values for attributes and elements inside the XML-DTD configuration template in either of two ways: positionally or explicitly.

  • With positional definitions, ACM-PRINTABLE and ACM-DESCRIPTION are inserted directly after the element or attribute they are describing inside the XML-DTD configuration template.
  • With explicit definitions, ACM-PRINTABLE and ACM-DESCRIPTION can be defined anywhere in the template.
<!ELEMENT db-config (db-host,db-name,db-user,db-password)>
<!--
ACM-PRINTABLE = database configuration
ACM-DESCRIPTION = The db-config element specifies the data structure that contains the information needed to connect to a database.
-->
<!ELEMENT db-host (#PCDATA)>
<!--
ACM-PRINTABLE = database hostname
ACM-DESCRIPTION = The db-host element specifies the name of the host computer (the server) on which the database engine is running.
-->
<!ELEMENT db-name (#PCDATA)>
<!--
ACM-PRINTABLE = database name
ACM-DESCRIPTION = The db-name element specifies the name of the database.
-->

<!ELEMENT db-user (#PCDATA)>
<!--
ACM-PRINTABLE = database user
ACM-DESCRIPTION = The db-user element specifies the user identification used to connect to the database.
-->

<!ELEMENT db-password (#PCDATA)>
<!--
ACM-PRINTABLE = database password
ACM-DESCRIPTION = The db-password element specifies the password used to connect to the database.
-->

Add positional custom display settings

The positional method for adding element tables and mouse-over text to an XML template is to add a comment immediately after the element or attribute definition you want to define, and in that comment set the ACM-PRINTABLE and ACM-DESCRIPTION values. In other words, for either XML elements or attributes, you can specify a label and a mouse-over description for the label directly.

In the following example, each XML element from mysql.xml defines a ACM-PRINTABLE and ACM-DESCRIPTION setting immediately after each element in the XML-DTD template.

Add explicit custom display settings

The explicit method for adding settings to an XML-DTD template allows you to define ACM-PRINTABLE and ACM-DESCRIPTION values anywhere in the configuration template by specifying the element name with the ACM-ELEMENT tag and optionally the attribute name with the ACM-ATTRIBUTE tag.

For this method the ACM-ELEMENT tag is required, even when defining printable and description values for attributes, because attributes are always associated with specific elements.

Once you have set the ACM-ELEMENT and the ACM-ATTRIBUTE tags, you can also set the ACM-DESCRIPTION and ACM-PRINTABLE tags within the same comment block. You should only use one definition per comment-block. In other words, define a ACM-PRINTABLE and ACM-DESCRIPTION for a single element, and then start a new comment block for the next element.

The ACM-ELEMENT tag and ACM-ATTRIBUTE tag (when applicable) should be defined before the ACM-PRINTABLE and ACM-DESCRIPTION tags.

For example, to customize the mysql.tpl template, you would construct the template as follows:

<!--
ACM-TIMEOUT = 1
ACM-FILENAME-KEY = /files/TravelManager
ACM-FILENAME-DEFAULT = /var/www/html/we/mysql2.xml
ACM-NAMESPACE = /TravelManager/
ACM-DOCTYPE = db-config
ACM-DOCTYPE-SYSTEM-ID = mysql.dtd
ACM-DOCTYPE-PUBLIC-ID = -//Williams Events//Travel Manager//EN
-->

<!ELEMENT db-config (db-host,db-name,db-user,db-password)>
<!ELEMENT db-host (#PCDATA)>
<!ELEMENT db-name (#PCDATA)>
<!ELEMENT db-user (#PCDATA)>
<!ELEMENT db-password (#PCDATA)>

<!--
ACM-ELEMENT = db-config
ACM-PRINTABLE = database configuration
ACM-DESCRIPTION = The db-config element specifies the data structure that contains the information needed to connect to a database.
-->

<!--
ACM-ELEMENT = db-host
ACM-PRINTABLE = database hostname
ACM-DESCRIPTION = The db-host element specifies the name of the host computer (the server) on which the database engine is running.
-->

<!--
ACM-ELEMENT = db-name
ACM-PRINTABLE = database name
ACM-DESCRIPTION = The db-name element specifies the name of the database.
-->

<!--
ACM-ELEMENT = db-user
ACM-PRINTABLE = database user
ACM-DESCRIPTION = The db-user element specifies the user identification used to connect to the database.
-->

<!--
ACM-ELEMENT = db-password
ACM-PRINTABLE = database password
ACM-DESCRIPTION = The db-password element specifies the password used to connect to the database.
-->

Customize how elements display in the SA Client

In both cases, whether you add these attributes positionally or explicitly, the end result is the same: the value set editor displays the element names (defined in ACM-PRINTABLE) and the mouse-over text (defined in ACM-DESCRIPTION) in the SA Client, as shown in the following figure.

Custom element names and mouse-over text