Which of the following statements about XML parsers is incorrect?

2017

Which of the following statements about XML parsers is incorrect?

Answer: B. A validating parser ensures that the XML document is well formed but not valid.ConceptAn XML document is well-formed when it follows XML syntax and nesting rules. It is valid only when it also conforms to the constraints declared by a…

  1. A.

    A parser is a software program that checks the syntax used in an XML file.

  2. B.

    A validating parser ensures that the XML document is well formed but not valid.

  3. C.

    A validating parser checks syntax as well as compares the structure of the XML document.

  4. D.

    Non-validating parser only checks for structure problems with the XML code.

Attempted by 310 students.

Show answer & explanation

Correct answer: B

Concept

An XML document is well-formed when it follows XML syntax and nesting rules. It is valid only when it also conforms to the constraints declared by a DTD or XML Schema.

Both validating and non-validating XML processors check well-formedness. A validating processor additionally checks validity constraints, whereas a non-validating processor is not required to perform that validity check.

Application

  1. The statement about a validating parser says that it ensures a document is well-formed but not valid.

  2. That wording conflicts with the definition of validation: a validating processor checks well-formedness and also reports violations of the declared validity constraints.

  3. Therefore, the statement ‘A validating parser ensures that the XML document is well formed but not valid’ is the incorrect statement.

Contrast and cross-check

  • A parser checking XML syntax describes the well-formedness check required of conforming XML processors.

  • A validating parser checking syntax and comparing document structure with declarations describes the additional validity check.

  • A non-validating parser checking structural or syntax problems describes the well-formedness check, without requiring DTD or schema validation.

Thus, the saved answer is supported. The learner-reported first statement is true, but the question asks for the incorrect statement, so it is not another answer.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…