What should you do to validate the XML against a schema that is contained in the books.xsd file when the XML loads?

A Windows Forms application loads an XmlDocument from a file named books.xml. You need to validate the XML against a schema that is contained in the books.xsd file when the XML loads. What should you do?

A Windows Forms application loads an XmlDocument from a file named books.xml. You need to validate the XML against a schema that is contained in the books.xsd file when the XML loads. What should you do?

A.
Associate the schema file with an XmlReader.
Load the XmlDocument by using the XmlReader.

B.
Add the schema to the Schemas property of the XmlDocument.
Call the Load method of the XmlDocument
by setting the filename parameter to books.xsd.

C.
Call the Load method of the XmlDocument by setting the filename parameter to books.xsd, and then call the Loat method by setting the filename parameter to books.xml.

D.
Call the Load method of the XmlDocument by setting the filename parameter to books.xsd. Programatically add the attriubte xsi:schemaLocation to the root node.
Set the value of this attribute to books.xsd.



Leave a Reply 0

Your email address will not be published. Required fields are marked *