Understanding
XML DTD #implied
An XML
DTD defines how an XML document should be organized. The order of the
elements and the number of elements are defined in the DTD.
_______________________________________________
If
you want to define the attributes and how they should be created in
an XML element you will be using ATTLIST in the DTD. Consider the example
where there are multiple book nodes and each book node has a title node
and one or more author node.
The book
element has an attribute called category. In our case it is not compulsory
to have an attribute in that element. In such cases you will be using
the keyword #IMPLIED. This implies that the attribute is not compulsory
to be present in the element.
<!ELEMENT
books ( book+ ) >
<!ELEMENT book ( title, author+ ) >
<!ATTLIST book category NMTOKEN #IMPLIED >
<!ELEMENT title ( #PCDATA ) >
<!ELEMENT author ( #PCDATA ) >
#DEFAULT,
#REQUIRED, and #FIXED are the other values that could be used for the
attribute.