ITPEC IP October 2022 Question 6
Which of the following is the method for describing the logical structure of a sentence in XML?
Explanation
Enclosing the elements with tags — XML marks each element with a start tag and an end tag, and nesting the tags shows the structure.
For a sentence, a tag pair such as <sentence> … </sentence> encloses the whole sentence, and tag pairs for its clauses sit inside it. The nesting forms a tree, so the logical structure can be read by programs. In XML the tag names are chosen by the user to describe what the data means.
Answer (c)
Why not others:
- •(a) — double quotes enclose attribute values in XML; they do not mark the elements of a structure
- •(b) — commas separate values in flat formats such as CSV, which cannot express nesting
- •(d) — tabs separate fields in tab-delimited text; in XML they are only whitespace
Key rule: XML describes structure with user-defined tags nested inside each other; CSV and tab-delimited files hold flat rows of values only.
Algorithm and Programming · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.