Validating XML with RELAX NG Add comment to Wiki View in Wiki Edit Wiki page Printable Version

This example assumes the following class is already on your CLASSPATH:

XmlExamples.groovy

A number of RELAX NG validators are available (e.g. MSV and Jing). Rather than using the APIs for these validators directly, you might want to consider using the ISO RELAX project's common JARV API for accessing validators. Using this common API, you can switch between the available validators without changing your source code.

An even better option (if you are using Java 5 or above, or otherwise have JAXP 1.3 available to you) is to use the ISORELAX JARV to JAXP 1.3 Xml Validation Engine Adaptor. This hooks into the built-in JAXP validation Factory support in JAXP and makes the code that you use to access the RELAX NG validator the same as you would do for a W3C XML Schema validator.

Here is what the code would look like:

 

Search

Results of your search request can come from various sources: the Groovy website itself, the JIRA issues, the API documentation, as well as a few other interesting Groovy-related blogs.

  By  -  pages  -  views  - last modified