Which of the following events should you use to handle the events of the XmlDocument class?

You are busy using the XmlDocument class to control an XML document. If the XML attribute is modified and inserted, you need to perform validation and return the XmlDocumant instance to the original state if the validation fails. Which of the following events should you use to handle the events of the XmlDocument class?

You are busy using the XmlDocument class to control an XML document. If the XML attribute is modified and inserted, you need to perform validation and return the XmlDocumant instance to the original state if the validation fails. Which of the following events should you use to handle the events of the XmlDocument class?

A.
NodeChanged and NodeInserting

B.
NodeChanged and NodeInserted

C.
NodeChanging and NodeInserted

D.
NodeChanging and NodeInserting

Explanation:
When the Xml node is about to change, an NodeChanging event is raised. So you need to handle the NodeChanging and NodeInserting events.

Incorrect Answers:
A: When the node has changed and then the event is raised, it will be too late. You should not handle the NodeChanged event.
B: When the node has changed and then the event is raised, it will be too late. You should not handle the NodeChanged event. The NodeInserted will also raise after the event has happened.
C: You should not handle the NodeChanged event. The NodeInserted will also raise after the event has happened.
D: Write data in XML format from the DOM.



Leave a Reply 0

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