Package uk.ac.starlink.ttools.taplint
Class XsdValidation
- java.lang.Object
-
- uk.ac.starlink.ttools.taplint.XsdValidation
-
public class XsdValidation extends java.lang.Object
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 Classes Modifier and Type Class Description static class
XsdValidation.Result
Enumerates possible results of the parse.
-
Constructor Summary
Constructors Constructor Description XsdValidation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Main method.static XsdValidation.Result
validateDoc(Reporter reporter, java.net.URL docUrl, java.lang.String topElName, java.lang.String topElNamespaceUri, boolean includeSummary)
Validates a given document XML document against its declared schema.
-
-
-
Method Detail
-
validateDoc
public static XsdValidation.Result validateDoc(Reporter reporter, java.net.URL docUrl, java.lang.String topElName, java.lang.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
public static void main(java.lang.String[] args) throws java.io.IOException
Main method. Usage: <url-to-validate> [<expected-top-level-element>].- Throws:
java.io.IOException
-
-