Skip to content

vrprep-model-0.1.3

Compare
Choose a tag to compare
@hlobit hlobit released this 06 Oct 08:28
· 27 commits to master since this release

Jar files now contains an xsd folder with every xsd file of the repository.
This is useful to validate your files against the schema.
You can get the schema as showed in the following code snippet :

import java.io.InputStream;

import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;

import org.vrprep.model.instance.Instance;

...

InputStream stream = Instance.class.getResourceAsStream("/xsd/instance.xsd");
Source schemaSource = new StreamSource(stream);
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = sf.newSchema(schemaSource);