Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "COSMOS SDD Tooling Validator Design"

Line 9: Line 9:
 
All rules must implement the <tt>ValidationRule</tt> interface, which contains a single method: <tt>validate()</tt>. A rule may perform any kind of validation action desired, provided it takes an <tt>InputStream</tt> as input and returns an array of <tt>XMLValidationError</tt>. Below are the pre-written rule types included with the Validator.
 
All rules must implement the <tt>ValidationRule</tt> interface, which contains a single method: <tt>validate()</tt>. A rule may perform any kind of validation action desired, provided it takes an <tt>InputStream</tt> as input and returns an array of <tt>XMLValidationError</tt>. Below are the pre-written rule types included with the Validator.
  
== XML Schema Rules ==
+
=== XML Schema Rules ===
  
 
<tt>SchemaValidationRule</tt> provides functionality for validating against one or more XML Schemas. A <tt>SchemaValidationRule</tt> is constructed with an array of either <tt>Files</tt> or <tt>InputStreams</tt> containing the schemas against which the XML will be validated. Schemas may be added to or removed from the rule at any time. It is also possible to get a list of all schema <tt>Files</tt> or <tt>InputStreams</tt> associated with an instance of <tt>SchemaValidationRule</tt>.
 
<tt>SchemaValidationRule</tt> provides functionality for validating against one or more XML Schemas. A <tt>SchemaValidationRule</tt> is constructed with an array of either <tt>Files</tt> or <tt>InputStreams</tt> containing the schemas against which the XML will be validated. Schemas may be added to or removed from the rule at any time. It is also possible to get a list of all schema <tt>Files</tt> or <tt>InputStreams</tt> associated with an instance of <tt>SchemaValidationRule</tt>.
Line 15: Line 15:
 
<tt>SchemaValidationRule</tt> performs validation using the [http://jaxp.dev.java.net/ Java API for XML Processing (JAXP)], which allows the validation to be independent of the underlying XML parser and thus run the same on different JRE versions and implementations.
 
<tt>SchemaValidationRule</tt> performs validation using the [http://jaxp.dev.java.net/ Java API for XML Processing (JAXP)], which allows the validation to be independent of the underlying XML parser and thus run the same on different JRE versions and implementations.
  
== Schematron Rules ==
+
=== Schematron Rules ===
  
 
<tt>SchematronValidationRule</tt> provides functionality for validating against an [http://www.schematron.com/ ISO Schematron] rules file. A <tt>SchematronValidationRule</tt> is constructed with a Schematron rules file and a Schematron skeleton file. The provided implementation is tied to the [http://www.schematron.com/validators.html Schematron Text] validator, which extends the base ISO Schematron skeleton file. Users would need to create a Custom Rule if another type of Schematron error reporting is desired.
 
<tt>SchematronValidationRule</tt> provides functionality for validating against an [http://www.schematron.com/ ISO Schematron] rules file. A <tt>SchematronValidationRule</tt> is constructed with a Schematron rules file and a Schematron skeleton file. The provided implementation is tied to the [http://www.schematron.com/validators.html Schematron Text] validator, which extends the base ISO Schematron skeleton file. Users would need to create a Custom Rule if another type of Schematron error reporting is desired.
Line 21: Line 21:
 
Briefly, a Schematron skeleton is an XSL Transform that can be thought of as a compiler for rules files. The result of transforming the rules file with the skeleton is another XSL Transform, which can then be applied against an XML file to generate an error report. <tt>SchematronValidationRule</tt> takes care of compiling the rules file are parsing the generated error report.
 
Briefly, a Schematron skeleton is an XSL Transform that can be thought of as a compiler for rules files. The result of transforming the rules file with the skeleton is another XSL Transform, which can then be applied against an XML file to generate an error report. <tt>SchematronValidationRule</tt> takes care of compiling the rules file are parsing the generated error report.
  
== SDD Specific Rules ==
+
=== SDD Specific Rules ===
  
More info goes here about rules required to ensure compliance with SDD spec, above what the Schema requires.
+
'''More info goes here about rules required to ensure compliance with SDD spec, above what the Schema requires.'''
  
== Custom Java Rules ==
+
=== Custom Java Rules ===
 +
 
 +
Users can create their own rules to perform other types of validation beyond what the included rule types provide. There is no restriction on what custom rules can do, other than that they must implement the <tt>ValidationRule</tt> interface.
  
 
= Interfaces =
 
= Interfaces =
== API's ==
+
=== API's ===
== Command Line ==
+
=== Command Line ===
  
More info about command line interface goes here.
+
'''More info about command line interface goes here.'''
  
 
[[Category:SDD Tooling]]
 
[[Category:SDD Tooling]]

Revision as of 12:42, 29 February 2008

Overview

The SDD Validator is an Eclipse plug-in that provides functionality for validating XML against various types of rule sets. Currently supported types of rules are XML Schema rules, Schematron rules and custom user created rules written in Java. The Validator also provides the ability to read XML into SDO's, and write the SDO's back out to XML. While intended primarily for working with SDD's, the Validator is flexible enough to handle any arbitrary XML.

There are two methods available for using the Validator. First, an Eclipse based application may required the Validator as plug-in dependency and use the provided API's. Second, the Validator includes the ability to run as an Eclipse Rich Client Platform (RCP) application with a command line interface.

Rules

All rules must implement the ValidationRule interface, which contains a single method: validate(). A rule may perform any kind of validation action desired, provided it takes an InputStream as input and returns an array of XMLValidationError. Below are the pre-written rule types included with the Validator.

XML Schema Rules

SchemaValidationRule provides functionality for validating against one or more XML Schemas. A SchemaValidationRule is constructed with an array of either Files or InputStreams containing the schemas against which the XML will be validated. Schemas may be added to or removed from the rule at any time. It is also possible to get a list of all schema Files or InputStreams associated with an instance of SchemaValidationRule.

SchemaValidationRule performs validation using the Java API for XML Processing (JAXP), which allows the validation to be independent of the underlying XML parser and thus run the same on different JRE versions and implementations.

Schematron Rules

SchematronValidationRule provides functionality for validating against an ISO Schematron rules file. A SchematronValidationRule is constructed with a Schematron rules file and a Schematron skeleton file. The provided implementation is tied to the Schematron Text validator, which extends the base ISO Schematron skeleton file. Users would need to create a Custom Rule if another type of Schematron error reporting is desired.

Briefly, a Schematron skeleton is an XSL Transform that can be thought of as a compiler for rules files. The result of transforming the rules file with the skeleton is another XSL Transform, which can then be applied against an XML file to generate an error report. SchematronValidationRule takes care of compiling the rules file are parsing the generated error report.

SDD Specific Rules

More info goes here about rules required to ensure compliance with SDD spec, above what the Schema requires.

Custom Java Rules

Users can create their own rules to perform other types of validation beyond what the included rule types provide. There is no restriction on what custom rules can do, other than that they must implement the ValidationRule interface.

Interfaces

API's

Command Line

More info about command line interface goes here.

Back to the top