Declaring
attributes the attributes can be created in XML DTD by using ATTLIST
Declaration.
(a.) Declare on
attribute containing default value:
Syntax:
<!ATTLIST
element_name attribute_name attribute_type default_value>
Ex:
<!ATTLIST student course CDATA “XML”>
(b.) Declaring an
attribute that is optional
Syntax:
<!ATTLIST element_name attribute_name attribute_type #IMPLIED>
Ex: <!ATTLIST
student type CDATE #IMPLIED>
(c.) Declare an attribute
that is mandatory
Syntax:
<!ATTLIST element_name attribute_name attribute_type #REQUIRED>
Example:
<!ATTLIST student course DCATA #REQUIRED>
(d.) Declare an
attribute that whose value is fixed
Syntax:
<!ATTLIST element_name attribute_name attibute>
Example:
<!ATTLIST student course CDATA #FIXED “XML”>
(e.) Declare an
attribute with enumerated list of values
SYNTAX:
<!ATTLIST element_name attribute_name (enum value1/enumvalue2/...)
default_value>
Example:<!ATTLIST
student course(xml/html/java/.net)” java”>
ElementEntity
No comments:
Post a Comment