XML Schema Validation 1.1 in Java
dev.to·5h·
Discuss: DEV
Flag this post

This week, I received an interesting task: dusting off a legacy Java application. The application analyzes specific XML files in proprietary format. I know XML doesn’t sound sexy to junior developers, but it has an amazing benefit. One can validate a file against a grammar. Such grammar is called an XSD, the acronym for XML Schema Definition. Fun fact: you write XSDs in XML.

In this post, I explain the problem, what I tried, and the final working solution.

The problem

The good thing is that the application already uses XSD. Yet, at the time of the application’s inception, XSD validation was in version 1.0. Version 1.1 added several significant features. In particular, v1.1 adds [assertions](htt…

Similar Posts

Loading similar posts...