Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML

DTD Attribute Types - ENTITY

The attribute type of ENTITY is used for referring to the name of an entity you've declared in your DTD.

Syntax:

<!ATTLIST element_name
attribute_name ENTITY default_value>

Example:

<!ATTLIST mountain
photo ENTITY #IMPLIED>
<!ENTITY mt_cook_1 SYSTEM "mt_cook1.jpg">

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

<mountains>
  <mountain photo="mt_cook_1">
    <name>Mount Cook</name>
  </mountain>
  <mountain>
    <name>Cradle Mountain</name>
  </mountain>
</mountains>

Invalid XML - The following XML document would be invalid. This is because the "photo" attribute of the second element contains a value that hasn't been declared as an entity:

<mountains>
  <mountain photo="mt_cook_1">
    <name>Mount Cook</name>
  </mountain>
  <mountain photo="None">
    <name>Cradle Mountain</name>
  </mountain>
</mountains>
Print Version

Enjoy this website?

  • Share
  • Add this page to your Favorites
  • Link to this page (copy/paste into your own website or blog):
  • Link to Quackit using one of these banner ads.
  • Help support Quackit by making a donation

Oh, and thank you for supporting Quackit!

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