Search code examples
htmlxmldtddoctype

Where are HTML general entities defined?


From the HTML DTD:

<!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
<!ATTLIST A
  %attrs;                              -- %coreattrs, %i18n, %events --
  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
  type        %ContentType;  #IMPLIED  -- advisory content type --
  name        CDATA          #IMPLIED  -- named link end --
  href        %URI;          #IMPLIED  -- URI for linked resource --
  hreflang    %LanguageCode; #IMPLIED  -- language code --
  target      %FrameTarget;  #IMPLIED  -- render in this frame --
  rel         %LinkTypes;    #IMPLIED  -- forward link types --
  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
  accesskey   %Character;    #IMPLIED  -- accessibility key character --
  shape       %Shape;        rect      -- for use with client-side image maps --
  coords      %Coords;       #IMPLIED  -- for use with client-side image maps --
  tabindex    NUMBER         #IMPLIED  -- position in tabbing order --
  onfocus     %Script;       #IMPLIED  -- the element got the focus --
  onblur      %Script;       #IMPLIED  -- the element lost the focus --
  >

Which file defines what these entities are, for example %LinkTypes; or %Script; ?


Solution

  • In the linked HTML DTD are entity declarations such as

    <!ENTITY % LinkTypes "CDATA"
        -- space-separated list of link types
        -->
    
    <!ENTITY % Script "CDATA" -- script expression -->
    

    Given these declarations, you can see that both %LinkTypes; and %Script; expand to CDATA (character data); the comment provides some additional guidance on their intended form or use.