[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
entity
For example, if you have several elements within your DTD which contain the same types of information, you could declare each indivudally as follows:
But for a complicated DTD with many elements, this could become laborious. Alternately, you could declare one entity as follows:
And then subsequently declare your elements as follows:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
entity
entity
An '''entity''' in an XML Document Type Definition is a declaration somewhat like a string constant which can then be reused within the DTD or within the XML document itself.For example, if you have several elements within your DTD which contain the same types of information, you could declare each indivudally as follows:
<!ELEMENT title (#PCDATA|bold|ital|undl|strk)> <!ELEMENT sentence (#PCDATA|bold|ital|undl|strk)>
But for a complicated DTD with many elements, this could become laborious. Alternately, you could declare one entity as follows:
<!ENTITY % inline "(#PCDATA|bold|ital|undl|strk)">
And then subsequently declare your elements as follows:
<!ELEMENT title %inline> <!ELEMENT sentence %inline>
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
