About Node Properties in DTDs

Each node in a DTD is associated with one or more properties. Every node has a Type property. The properties associated with a node vary according to the value of the Type property. Stylus Studio supports the following values for the Type property of a node in a DTD:

  • Element
  • Attribute
  • DTD Modifier
  • PCDATA
  • Entity
  • Parameter Entity
  • Text
  • Comment

To determine the properties for a particular node in a DTD, click the node. Stylus Studio displays the properties in the Properties window. If the Properties window is not visible, select View > Properties from the Stylus Studio menu bar.

To change a property, double-click the property value in the Properties window. Enter the new value or, if a drop-down menu appears, double-click the value you want. Any changes you make in the Properties window are immediately reflected in the Tree and Text views. You cannot change the type property of a node.

The remainder of this section discusses the following topics:

Description of Element Properties in DTDs

An element has three properties: Type, Name, and Content Model. The Name property is a string that identifies the element. The Content Model property describes the allowed contents for the element. Table 56 describes the possible values of the Content Model property for Element nodes:

Value of Content Model Property
Description
Empty
This element can contain only attributes.
Element Only
This element can contain attributes and specified elements. It cannot directly contain raw data.
Mixed
This element can contain attributes, specified elements, and raw data.
Any
This element can contain attributes, any elements defined in this DTD, and raw data.
Table 56. Element Property Descriptions

Description of Attribute Properties in DTDs

Table 57 shows the properties that an attribute can have. It also provides the possible values, and a description for each property.

Property
Allowable Values
Description
Type
Attribute
All attribute nodes have this type.
Name
String
Identifier for the particular attribute.
Restrictions
Fixed
The attribute is required and it must always have the value specified by the Default property. You must always explicitly specify this attribute.
 
Implied
The attribute is optional. There is no default value.
 
Optional
The attribute is optional. If you do not specify it, the XML parser uses the value of the Default property.
 
Required
The element must always explicitly specify this attribute and assign a value to it.
Content Type
CDATA
The attribute value can contain any valid character data. It is a text string.
 
Entity
The attribute value is the name of an entity defined in the DTD.
 
Entities
The attribute value is a space-separated list of entities that are defined in the DTD.
 
Enumerated
The attribute value is one of a set of specified values. When the value of the Content Type property is Enumerated, the attribute has an additional property: Allowed Values. Specify the allowed values in a space-separated list.
 
ID
The attribute value is a unique name within the DTD.
 
IDREF
The attribute value is an ID that is defined in the DTD.
 
IDREFs
The attribute value is a space-separated list of IDs that are defined in the DTD.
 
NMToken
The attribute value is a valid XML name that is composed of letters, numbers, hyphens, underscores, and colons.
 
NMTokens
The attribute value is a space-separated list of name tokens.
 
Notation
The name of a notation specified in the DTD. The notation describes a non-XML data format, such as those used for image files. When the value of the Content Type property is Notation, the attribute has an additional property: Allowed Values. Specify the allowed values in a space-separated list.
Table 57. Attribute Property Descriptions

Description of Entity and Parameter Entity Properties in DTDs

Table 58 shows the properties that an entity or parameter entity can have. It also provides the possible values, and a description for each property.

Property
Allowable Values
Description
Type
Entity
Parameter Entity
All entity nodes have this type.
Name
String
Identifier for this entity.
Location
External or Internal
An external location indicates that the value of the entity is in a file that is outside the DTD file.
An internal location indicates that the value of the entity is defined in the Value property of this entity node.
Value
String
If the value of the Location property is Internal, this property specifies the value of the entity. If the value of the Location property is External, you cannot specify this property.
Public ID
String
String that some parsers can resolve to a file location. Stylus Studio ignores any value you specify.
System ID
String
Path or URI for a file that contains the value of the entity.
Parsed
True or False
Indicates whether the entity value is parsed XML. A parameter entity does not have this property.
Table 58. Entity and Parameter Entity Property Descriptions

 
Free Stylus Studio XML Training: