spring-framework / org.springframework.util.xml / XmlValidationModeDetector

XmlValidationModeDetector

open class XmlValidationModeDetector

Detects whether an XML stream is using DTD- or XSD-based validation.

Author
Rob Harrop

Author
Juergen Hoeller

Since
2.0

Constructors

<init>

XmlValidationModeDetector()

Detects whether an XML stream is using DTD- or XSD-based validation.

Properties

VALIDATION_AUTO

static val VALIDATION_AUTO: Int

Indicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).

VALIDATION_DTD

static val VALIDATION_DTD: Int

Indicates that DTD validation should be used (we found a "DOCTYPE" declaration).

VALIDATION_NONE

static val VALIDATION_NONE: Int

Indicates that the validation should be disabled.

VALIDATION_XSD

static val VALIDATION_XSD: Int

Indicates that XSD validation should be used (found no "DOCTYPE" declaration).

Functions

detectValidationMode

open fun detectValidationMode(inputStream: InputStream): Int

Detect the validation mode for the XML document in the supplied InputStream. Note that the supplied InputStream is closed by this method before returning.