attlist declaration
TRANSCRIPT
-
8/10/2019 ATTLIST Declaration
1/6
ATTLIST Declaration
Attributes are additional information associated with an element type . They are intended forinterpretation by an application. The ATTLIST declarations identify which element types may haveattributes, what type of attributes they may be, and what the default value of the attributes are.
...
where:
element_name: name of the element to which the attribute applies.
Example:
]>
Rules:
All attributes used in an XML document must be declared in theDocument Type Definition
(DTD) using an Attribute-List Declaration .
Attributes may only appear in start or empty tags .
The keyword ATTLISTmust be in upper case .
Note:
There are three main attribute types; a string type, tokenized types, and enumerated types. They areclassified as follows.
String AttributeType:
Attribute Description:
CDATACDATAstands for character data, that is, text that does not form markup.See
example.
TokenizedAttribute Type:
Attribute Description:
http://xmlwriter.net/xml_guide/attlist_declaration.shtml#AttributeTypehttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#DefaultValuehttp://xmlwriter.net/xml_guide/doctype_declaration.shtmlhttp://xmlwriter.net/xml_guide/doctype_declaration.shtmlhttp://xmlwriter.net/xml_guide/doctype_declaration.shtmlhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#CdataExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#CdataExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#CdataExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#CdataExhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/glossary.shtmlhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#CdataExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#CdataExhttp://xmlwriter.net/xml_guide/doctype_declaration.shtmlhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#DefaultValuehttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#AttributeType -
8/10/2019 ATTLIST Declaration
2/6
ID
IDis a unique identifier of the attribute.IDs of a particular value should not
appear more than once in an XML document . An element type may only have
one IDattribute . An IDattribute can only have an #IMPLIEDor #REQUIRED
default value . The first character of an IDvalue must be a letter, '_', or ':'
.See example.
IDREFIDREFis used to establish connections between elements. The IDREFvalue of theattribute must refer to an IDvalue declared elsewhere in the document . The
first character of an IDvalue must be a letter, '_', or ':' .See example.
IDREFS Allows multiple IDvalues separated by whitespace .
ENTITY
ENTITYs are used to reference data that act as an abbreviation or can be found at
an external location. The first character of an ENTITYvalue must be a letter, '_',
or ':' .See example.
ENTITIES Allows multiple ENTITYnames separated by whitespace .See example.
NMTOKENThe first character of an NMTOKENvalue must be a letter, digit, '.', '-', '_', or
':' .See example.
NMTOKENS Allows multiple NMTOKENnames separated by whitespace .
Enumerated
Attribute Type:Attribute Description:
NOTATION
NOTATIONs are useful when text needs to be interpreted in a particular way, for
example, by another application. The first character of a NOTATIONname must be
a letter, '_', or ':' .See example.
Enumerated
Enumerated attribute types allow you to make a choice between differentattribute values. The first character of an Enumerated value must be a letter,
digit, '.', '-', '_', or ':' .See example.
CDATA Example:
]>
ID Example:
]>
http://xmlwriter.net/xml_guide/attlist_declaration.shtml#DefaultValuehttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdrefExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdrefExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdrefExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntityExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntityExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntityExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntitiesExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntitiesExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntitiesExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NmtokenExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NmtokenExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NmtokenExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NotationExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NotationExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NotationExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EnumeratedExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EnumeratedExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EnumeratedExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EnumeratedExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NotationExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#NmtokenExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntitiesExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#EntityExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdrefExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#IdExhttp://xmlwriter.net/xml_guide/attlist_declaration.shtml#DefaultValue -
8/10/2019 ATTLIST Declaration
3/6
Jo Smith
IDREF Example:
]>Alex FooSarah BarJo Smith
ENTITY Example:
]>
ENTITIES Example:
]>
NMTOKEN Example:
]>
-
8/10/2019 ATTLIST Declaration
4/6
Jo Smith
NOTATION Example:
]>Some VRML instructions
Enumerated Example:
]>This is an importanttask that must be completed
This task can wait
The "default_value" signifies whether an attribute is required or not, and if not, what default valueshould be displayed. The possible default values are listed in below.
Default Value: Description:
#REQUIRED The attribute must always be included .
#IMPLIED
The attribute does not have to be included.
#FIXED"Default_Value"
The attribute must always have the default value that is specified . If theattribute is not physically added to the element tag in the XML document, theXML processor will behave as though the default value does exist. The firstcharacter of a default value can be any character except for '&', '
-
8/10/2019 ATTLIST Declaration
5/6
]>
go to the bankpay the phone bill
Predefined attributes:
Predefined
Attributes:
Description:
xml:lang
Defines the language code in which the content of the element is written in. Theattribute values of xml:lang should follow ISO-639 if they are two-letter codes, andISO-3166 if they contain two-letter subcodes. Language identifiers registered with
the IANA should contain the prefix "I-" or "i-". Any privately used codes should
contain the prefix "X-" or "x-".
xml:spacePreserves white space within a document, that is, passes all white space to theapplication unchanged. Useful when displaying text such as program source code.
Example:
]>The following section of code displays the menu of userchoices and gets the user's request.
do{do
{ disp_menu();scanf(" %d", &ans);
} while ((ans3));
http://xmlwriter.net/xml_guide/glossary.shtml -
8/10/2019 ATTLIST Declaration
6/6