Package org.smooks.xml
Class XsdDOMValidator
- java.lang.Object
-
- org.smooks.xml.XsdValidator
-
- org.smooks.xml.XsdDOMValidator
-
public class XsdDOMValidator extends XsdValidator
XSD DOM Validator. Iterates through the document (DOM) gathering the namespaces. It validates based on the convention that the gathered namespace XSDs are provided on the classpath. It uses the namespace path (URI.getPath()), prepending it with "/META-INF" to perform a classpath resource lookup for the XSD i.e. the XSDs must be provided on the classpath below the "META-INF" package.- Author:
- tom.fennelly@gmail.com
-
-
Field Summary
-
Fields inherited from class org.smooks.xml.XsdValidator
SCHEMA_FACTORY
-
-
Constructor Summary
Constructors Constructor Description XsdDOMValidator(Document document)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
getDefaultNamespace()
static String
getDefaultNamespace(Element element)
Get the default namespace associated with the supplied element.List<URI>
getNamespaces()
void
validate()
Validate the document against the namespaces referenced in it.-
Methods inherited from class org.smooks.xml.XsdValidator
setErrorHandler, setSchemaFactory, setSchemaSourceResolver, setXSDSources, validate
-
-
-
-
Constructor Detail
-
XsdDOMValidator
public XsdDOMValidator(Document document) throws SAXException
- Throws:
SAXException
-
-
Method Detail
-
getDefaultNamespace
public URI getDefaultNamespace()
-
validate
public void validate() throws SAXException, IOException
Validate the document against the namespaces referenced in it.- Throws:
SAXException
- Validation error.IOException
- Error reading the XSD Sources.
-
-