public class Validator
extends java.lang.Object
Constructor and Description |
---|
Validator(java.lang.String schema)
Constructor that creates a new Validator object
|
Validator(java.lang.String schema,
org.xml.sax.EntityResolver resolver)
Constructor that creates a new Validator object
|
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Document |
parse(org.xml.sax.InputSource xml)
method which parses an xml document from an input source, validates it and
returns the subsequent Document object.
|
org.w3c.dom.Document |
parse(java.io.InputStream xml)
method which parses an xml document from an input stream, validates it and
returns the subsequent Document object.
|
org.w3c.dom.Document |
parse(java.io.Reader xml)
method which parses an xml document from a Reader, validates it and returns
the subsequent Document object.
|
public Validator(java.lang.String schema) throws java.lang.Exception
schema
- a valid url to the schema to processjava.lang.Exception
- if a parse error is encounteredpublic Validator(java.lang.String schema, org.xml.sax.EntityResolver resolver) throws java.lang.Exception
schema
- a valid url to the schema to processresolver
- an EntityResolver to use to retrieve included / imported
documentsjava.lang.Exception
- if a parse error is encounteredpublic org.w3c.dom.Document parse(java.io.InputStream xml) throws java.lang.Exception
xml
- the xml document as input streamjava.lang.Exception
- if the document fails to be validatedpublic org.w3c.dom.Document parse(java.io.Reader xml) throws java.lang.Exception
xml
- the xml document as readerjava.lang.Exception
- if the document fails to be validatedpublic org.w3c.dom.Document parse(org.xml.sax.InputSource xml) throws java.lang.Exception
xml
- the xml document as input sourcejava.lang.Exception
- if the document fails to be validated