detect element allows to specify which configuration to use for a given document type.
It works as follows: when XXE opens a document, it evaluates in turn the
detect element found in each configuration. When all the conditions found in a
detect element are met, XXE stops its evaluations and associates the configuration containing the matching
detect element to the document being opened.
rng_section_config/section.xxe (configuration based on RELAX NG):
<detect> <rootElementNamespace>http://www.xmlmind.com/ns/sect</rootElementNamespace> </detect>
detect element reads as: if the namespace of the root element of the file being opened is "
http://www.xmlmind.com/ns/sect", then its configuration is
detect element could be used as well for the configurations based on the DTD and the W3C XML Schema. However, in order to show you that there are often several ways to detect a document type, we have used a different
detect condition in the configuration based on DTD:
<detect> <dtdPublicId>-//XMLmind//DTD Simple Section//EN</dtdPublicId> </detect>