@Test
	public void testValidate() {
		try {
			PageXmlInputOutput.setAdditionalSchemaLocation("c:/junit/schema");
		} catch (NoSchemasException e) {
			fail(e.getMessage());
		}

		//Valid
		PageWriter writer;
		try {
			writer = PageXmlInputOutput.getWriterForLastestXmlFormat();
		} catch (UnsupportedSchemaVersionException e) {
			fail(e.getMessage());
			return;
		}
		try {
			assertTrue(writer.write(pageAllFeatures, new FileTarget(allFeaturesOutputFile)));
		} catch (UnsupportedFormatVersionException e) {
			e.printStackTrace();
		}

		//Valid2
		try {
			assertTrue(writer.write(page, new FileTarget(pageOutputFile)));
		} catch (UnsupportedFormatVersionException e) {
			e.printStackTrace();
		}

		//Invalid
		// Add an invalid attribute to a region
		pageAllFeatures.getLayout().getRegion(0).getAttributes().add(new StringVariable("kerning", new StringValue("not a number")));
		// Save and validate
		try {
			assertFalse(writer.write(pageAllFeatures, new FileTarget(allFeaturesOutputFile)));
		} catch (UnsupportedFormatVersionException e) {
			e.printStackTrace();
		}
		// Validate only
		try {
			assertFalse(writer.validate(pageAllFeatures));
		} catch (UnsupportedFormatVersionException e) {
			e.printStackTrace();
		}

	}