a) You will create a DTD from scratch. Write the correct DTD declaration for eac
ID: 3868133 • Letter: A
Question
a) You will create a DTD from scratch. Write the correct DTD declaration for each of the following descriptions. (Your answers should NOT be XML elements!) Declare an element e which has string content: Declare an element d which cannot have any content: Declare an element c which contains precisely one e followed by possibly one d: Declare an element b which has mixed content, namely strings mixed with any number of e elements: Declare an element a whose content will be a choice between a sequence of (one or more c, then one d, then 0 or more e, then one b) and a sequence of (one b, then one d, then one c): b) Write a minimal XML document that would validate against the DTD from question a).Explanation / Answer
Element with no content
<!ELEMENT element-name EMPTY>
Example:
<!ELEMENT br EMPTY>
XML example:
In this example address is declared as an empty element. The markup for address element would appear as <address />
Declaring Mixed Content
<!ELEMENT note (#PCDATA|to|from|header|message)*>
or <!ELEMENT elementname (#PCDATA|child1|child2)*>
for example
Element with string content
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.