At 03:20 PM 02/07/2001 +0000, Simon Harper wrote:
>Hi there, so call me silly but I've left my XML book at home, and I'm
>find a good definition of exactly what an XML entity is and what's its
Well, it depends. :) An XML document is formally considered to be an
entity, for example.
Most often, though, the term "entity" refers to a sort of shorthand markup
used to point to something else. The pre-defined entity named "amp" points
to the character "&", for instance. Actual use of an entity in a document
is called an entity reference, consisting of an ampersand, the entity's
name, and a semi-colon. So the entity reference corresponding to the "amp"
Entities can also stand in for longer blocks of XML content (to be used
like boilerplate), or even for non-XML content. Parameter entities are used
within DTDs as a shorthand for common attribute-declaration components,
content models, and so on. Single characters can be "entitized" by
including their numeric (hex or decimal) Unicode values between an opening
"&#" and a closing ";" -- if the number is in hex, the "#" is followed by
the letter "x".
Hope that helped!
John E. Simpson | "Is it weird in here, or is it just
http://www.flixml.org | me?" -- Steven Wright
XML Q&A: www.xml.com |