public class XMLValidator
extends java.lang.Object
Constructor and Description |
---|
XMLValidator() |
XMLValidator(org.dom4j.Document document,
java.lang.String schemaURI)
instanciates the validation of a dom4j document against
a schema available at the URI where the respective
schema can be found, e.g.:
...
|
XMLValidator(java.lang.String schemaURI) |
XMLValidator(java.lang.String xmlString,
java.lang.String schemaURI)
same as above, but with String as input parameter for the xml tree to validate
...
|
Modifier and Type | Method and Description |
---|---|
org.dom4j.Document |
getDocument()
returns the document that is set for validation
|
java.lang.String |
getSchemaURI()
returns the URI of the schema that was set for the validation of the
document
|
boolean |
isXML(java.io.File file) |
void |
setDocument(org.dom4j.Document document)
sets the document for validation
|
void |
setSchemaURI(java.lang.String string)
sets the URI to the schema used for the validation against the set
document.
|
boolean |
validate()
validates the document against the schema set by constructor or changed
by setSchemaURI.
|
boolean |
validate(java.io.File file) |
public XMLValidator()
public XMLValidator(java.lang.String schemaURI)
public XMLValidator(org.dom4j.Document document, java.lang.String schemaURI) throws org.dom4j.DocumentException
document
- is org.dom4j.DocumentschemaURI
- is Stringorg.dom4j.DocumentException
public XMLValidator(java.lang.String xmlString, java.lang.String schemaURI) throws org.dom4j.DocumentException
xmlString
- is an xml structure in a StringschemaURI
- is Stringorg.dom4j.DocumentException
public org.dom4j.Document getDocument()
public java.lang.String getSchemaURI()
public void setDocument(org.dom4j.Document document)
document
- public void setSchemaURI(java.lang.String string)
string
- public boolean validate() throws org.dom4j.DocumentException, java.io.IOException, org.xml.sax.SAXException
java.lang.Exception
org.dom4j.DocumentException
java.io.IOException
org.xml.sax.SAXException
public boolean validate(java.io.File file) throws org.dom4j.DocumentException, java.io.IOException, org.xml.sax.SAXException
org.dom4j.DocumentException
java.io.IOException
org.xml.sax.SAXException
public boolean isXML(java.io.File file)
Copyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.