Package uk.ac.starlink.ttools.taplint
Class XsdValidation
java.lang.Object
uk.ac.starlink.ttools.taplint.XsdValidation
Methods to perform validation against XSD schemas.
This is intended for use where the schemas are known by the
IvoaSchemaResolver.
- Since:
- 24 Sep 2018
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumerates possible results of the parse. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main method.static XsdValidation.Result
validateDoc
(Reporter reporter, URL docUrl, String topElName, String topElNamespaceUri, boolean includeSummary) Validates a given document XML document against its declared schema.
-
Constructor Details
-
XsdValidation
public XsdValidation()
-
-
Method Details
-
validateDoc
public static XsdValidation.Result validateDoc(Reporter reporter, URL docUrl, String topElName, String topElNamespaceUri, boolean includeSummary) Validates a given document XML document against its declared schema. If an expected top element name is supplied, a check is also made that the top element of the validated document matches it.Getting this right seems to be remarkably painful. See comments in the implementation for details.
- Parameters:
reporter
- destination for validation messagesdocUrl
- URL of XML document to validatetopElName
- expected name for top element; may be nulltopElNamespaceUri
- expected namespace for top element; only used for reporting messages, and ignored if topElName is nullincludeSummary
- if true, report an end-of-stage type summary- Returns:
- validation result
-
main
Main method. Usage: <url-to-validate> [<expected-top-level-element>].- Throws:
IOException
-