@elements = &'DTDget_elements();
DTDget_elements
retrieves a sorted array of all elements defined in the DTD.
@top_elements = &'DTDget_elements();
DTDget_top_elements
retrieves a sorted array of all top-most elements defined
in the DTD. Top-most elements are those elements that cannot be contained within
another element or can only be contained within itself.
%attribute = &'DTDget_elem_attr($elem);
DTDget_elem_attr
returns an associative array containing the attributes of
$elem
. The keys of the array are the attribute names, and the array values are $;
separated strings of the possible values for the attributes. Example of extracting an
attribute's values:
@values = split(/$;/, $attribute{`alignment'});
The first array value of the $;
splitted array is the default value for the attribute
(which may be an SGML reserved word). If the default value equals "#FIXED
",
then the next array value is the #FIXED
value. The other array values are all
possible values for the attribute.
$;
is assumed to be the default value assigned by Perl: "\034". If $;
is
changed, unpredictable results may occur.
@parent_elements = &'DTDget_parents($elem);
DTDget_parents
returns an array of all elements that may be a parent of $elem
.
@base_children = &'DTDget_base_children($elem, $andcon);
DTDget_base_children
returns an array of the elements in the base model
group of $elem
. The $andcon
is flag if the connector characters are included in
the returned array: 0
=> no connectors, 1
(non-zero) => connectors.
Example:
<!ELEMENT foo (x | y | z) +(a | b) -(m | n)>
The call &'DTDget_base_children(`foo')
will return (`x', `y', `z')
.
The call &'DTDget_base_children(`foo', 1)
will return (`(`,`x', `|',
`y', `|', `z', `)')
. One may use DTDis_tag_name to distinguish elements
from the connectors.
@exc_children = &'DTDget_exc_children($elem, $andcon);
DTDget_exc_children
returns an array of the elements in the exclusion model
group of $elem
. The $andcon
is flag if the connector characters are included in
the returned array: 0
=> no connectors, 1
(non-zero) => connectors.
Example:
<!ELEMENT foo (x | y | z) +(a | b) -(m | n)>
The call &'DTDget_exc_children(`foo')
will return (`m', `n')
.
@inc_children = &'DTDget_inc_children($elem, $andcon);
DTDget_inc_children
returns an array of the elements in the inclusion model
group of $elem
. The $andcon
is flag if the connector characters are included in
the returned array: 0
=> no connectors, 1
(non-zero) => connectors.
Example:
<!ELEMENT foo (x | y | z) +(a | b) -(m | n)>
The call &'DTDget_base_children(`foo')
will return (`a', `b')
.
&'DTDis_element($element);
DTDis_element
returns 1
if $element
is defined in the DTD. Otherwise, 0
is
returned.