Package org.apache.maven.doxia.util
Class XmlValidator
java.lang.Object
org.apache.maven.doxia.util.XmlValidator
A class to validate xml documents.
- Since:
- 1.1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Convenience class to beautifySAXParseException
messages. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
PATTERN_DOCTYPE
Doctype pattern i.e. ".*]*)>.*" see http://www.w3.org/TR/REC-xml/#NT-doctypedecl. -
PATTERN_TAG
Tag pattern as defined in http://www.w3.org/TR/REC-xml/#NT-Name -
xmlReader
lazy xmlReader to validate xml content -
logger
-
-
Constructor Details
-
XmlValidator
Constructor.- Parameters:
log
- a logger, not null.
-
-
Method Details
-
validate
Validate an XML content with SAX.- Parameters:
content
- a not null xml content- Throws:
ParseException
- if any.
-
getXmlReader
- Parameters:
hasDtdAndXsd
- to flag theErrorHandler
.- Returns:
- an xmlReader instance.
- Throws:
SAXException
- if any
-
getLog
-