Certified Professional in Python Programming (PCPP-32-101) — Question 21
Select the true statements about XML modules in the Python standard library. (Choose two.)
Answer options
- A. SAX is an acronym for "Simple API for XML".
- B. SAX is an interface for event-driven XML document analysis.
- C. The xml.sax module Is the minimum implementation of the Document Object Model (DOM).
- D. The xml.etree.ElementTree and xml.dom.minidom modules parse an XML document into a DOM.
Correct answer: B, D
Explanation
Option B is correct because SAX indeed serves as an interface for processing XML in an event-driven way. Option D is also correct as both xml.etree.ElementTree and xml.dom.minidom are used to parse XML documents into a DOM structure. Options A and C are incorrect; while A is true, it is not one of the selected answers, and C is wrong because the xml.sax module does not implement DOM, which is a different approach.