org.milyn.xml
Class XsdDOMValidator
java.lang.Object
org.milyn.xml.XsdValidator
org.milyn.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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XsdDOMValidator
public XsdDOMValidator(Document document)
throws SAXException
- Throws:
SAXException
getDefaultNamespace
public URI getDefaultNamespace()
getNamespaces
public List<URI> getNamespaces()
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.
getDefaultNamespace
public static String getDefaultNamespace(Element element)
- Get the default namespace associated with the supplied element.
- Parameters:
element - The element to be checked.
- Returns:
- The default namespace, or null if none was found.
Copyright © 2018. All rights reserved.