Develop > Application Configuration > Manage XML configuration files > DTD-Based XML configuration templates

DTD-based XML configuration templates

An XML-DTD configuration template is actually just an XML DTD with some application configuration options defined in the comments. Since the DTD standard defines the syntax and layout of an XML file, there is no need to redefine that syntax in another language.

For DTD-based XML files, XML-DTD configuration templates require the same three basic attributes required for a generic XML file — ACM-NAMESPACE, ACM-FILENAME-DEFAULT, and ACM-FILENAME-KEY — plus three other attributes:

  • ACM-DOCTYPE: Defines the name of the root element in the XML file. The root element follows the opening <!DOCTYPE declaration found in the target XML configuration file.
  • ACM-DOCTYPE-SYSTEM-ID: Defines the name of the associated DTD file on the managed server. This value is typically found in the XML configuration file as the SYSTEM attribute in the DOCTYPE element.
  • ACM-DOCTYPE-PUBLIC-ID: Defines a string that represents a public identifier of the XML document. This value is typically found in the XML configuration file as the PUBLICID attribute of a DOCTYPE element.

For a complete list of all XML configuration file attributes, see XML configuration template settings.

XML-DTD configuration template for mysql.xml

The following is an example of the configuration template created for the Travel Manager DTD-based XML file.

<!--
ACM-FILENAME-KEY = /files/TravelManager
ACM-FILENAME-DEFAULT = /var/www/html/we/mysql.xml
ACM-NAMESPACE = /TravelManager/
ACM-TIMEOUT = 1
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)>

In this example, the DOCTYPE attributes reference specific XML and DTD information that enables the parser to extract information from both the DTD file and the referenced XML file.

Specifically, the DTD-based XML configuration templates must contain the following information:

  • ACM-DOCTYPE: The root node of the targeted XML file. For mysql.xml, the root node is dbconfig.
  • ACM-DOCTYPE-SYSTEM-ID: The name of the DTD file being targeted by the configuration template. In the example of mysql.xml, the DTD being used is named mysql.dtd.
  • ACM-DOCTYPE-SYSTEM-ID: The public ID of the XML file.