What is the purpose of entities in DTD?
A
To define validation rules B
To define reusable content or external data references C
To declare default element values D
To structure large documents
Analysis & Theory
Entities allow reusable content (like common text) or references to external files/data.
Which declaration defines an internal entity in DTD?
A
<!ELEMENT entity ...> B
<!ENTITY name 'value'> C
<!ATTLIST entity ...> D
<!ENTITY name SYSTEM 'value'>
Analysis & Theory
Internal entities are declared using `<!ENTITY name 'replacement text'>`.
How do you use an entity named `authorNote` in an XML document?
A
#authorNote; B
$authorNote; C
&authorNote; D
@authorNote;
Analysis & Theory
Entities are referenced in XML using the `&entityName;` syntax.
Which declaration is used for external entity references?
A
<!ENTITY name 'file.txt'> B
<!ENTITY name SYSTEM 'file.txt'> C
<!ATTLIST name SYSTEM 'file.txt'> D
<!ELEMENT SYSTEM name>
Analysis & Theory
External entities use the `SYSTEM` keyword to reference external resources.
What is the output of using this entity?
`<!ENTITY company 'OpenAI Inc.'>`
and then in XML: `<note>&company;</note>`
A
<note>OpenAI Inc.</note> B
<note>&company;</note> C
<note>OpenAI</note> D
Syntax Error
Analysis & Theory
The entity `&company;` is replaced with its defined value, so it becomes `<note>OpenAI Inc.</note>`.
What is a parameter entity in DTD?
A
An entity used only in comments B
An entity used to declare parameters inside elements C
An entity used only inside the DTD, referenced with a `%` D
A global variable in XML
Analysis & Theory
Parameter entities are defined and used within the DTD itself, referenced using `%name;`.
Which of the following correctly declares a parameter entity?
A
<!ENTITY % htmlFormat 'HTML5'> B
<!ENTITY htmlFormat % 'HTML5'> C
<!PARAM % htmlFormat 'HTML5'> D
<!ATTLIST % htmlFormat 'HTML5'>
Analysis & Theory
Parameter entities are declared using `<!ENTITY % name 'value'>`.