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 Attributes

Print Version

Just as you need to define all elements in your DTD, you also need to define any attributes they use. You use the <!ATTLIST> declaration to define attributes in your DTD.

Syntax

You use a single <!ATTLIST> declaration to declare all attributes for a given element. In other words, for each element (that contains attributes), you only need one <!ATTLIST> declaration.

The <!ATTLIST> declaration has the following syntax:

<!ATTLIST element_name
  attribute_name TYPE DEFAULT_VALUE
  attribute_name TYPE DEFAULT_VALUE
  attribute_name TYPE DEFAULT_VALUE
  ...>

Here, element_name refers to the element that you're defining attributes for, attribute_name is the name of the attribute that you're declaring, TYPE is the attribute type, and DEFAULT_VALUE is it's default value.

Example

<!ATTLIST tutorial
  published CDATA "No">

Here, we are defining an attribute called "published" for the "tutorial" element. The attribute's type is CDATA and it's default value is "No".

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!
$7.49 .com domain names!
© Copyright 2000 - 2010 Quackit.com