Quackit Logo
$1.99 Domain Names
With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.
Create free Flash websites

DTD Attribute Types - Enumerated

Print Version

The enumerated attribute type provides for a list of possible values. This enables the DTD user to provide one value from the list of possible values.

The values must be surrounded by parentheses, and each value must be separated by a pipe (|).

Syntax:

<!ATTLIST element_name
attribute_name (value1 | value2 | value3) default_value>

Example:

<!ATTLIST tutorial
published (yes | no) "no">

Valid XML - The following XML document would be valid, as it conforms to the above DTD:

<tutorials>
  <tutorial published="yes">
    <name>XML Tutorial</name>
  </tutorial>
  <tutorial published="no">
    <name>HTML Tutorial</name>
  </tutorial>
  <tutorial>
    <name>CSS Tutorial</name>
  </tutorial>
</tutorials>

Invalid XML - The following XML document would be invalid because the value of the first attribute does not match one of the options of the ATTLIST declaration:

<tutorials>
  <tutorial published="true">
    <name>XML Tutorial</name>
  </tutorial>
  <tutorial published="no">
    <name>HTML Tutorial</name>
  </tutorial>
  <tutorial>
    <name>CSS Tutorial</name>
  </tutorial>
</tutorials>

Enjoy this website?

  1. Add this page to your Favorites
  2. Link to this page (copy/paste into your own website or blog):
  3. Help support Quackit by making a donation

Oh, and thank you for supporting Quackit!

FREE Hosting!
With every domain you register with ZappyHost you get FREE hosting.
Need Website Content?
Get unique, quality digital content for your website.
  • 270+ Website Templates
  • 800+ Flash Templates
  • 25,000+ Images, Logos
  • 30,000+ e-Books
  • 15,000+ Scripts
  • 27,000+ Animated GIFs
  • 21,000+ Ringtones
  • ...and much more!
Get your content now!
© Copyright 2000 - 2010 Quackit.com