strict = Boolean.FALSE;
} else if(wfs.isCiteCompliant()) {
strict = Boolean.TRUE;
}
Parser parser = new Parser(configuration);
parser.setValidating(strict);
// "inject" namespace mappings
List<NamespaceInfo> namespaces = configuration.getCatalog().getNamespaces();
for (NamespaceInfo namespace : namespaces ) {
if (namespace.equals( configuration.getCatalog().getDefaultNamespace() ))
continue;
parser.getNamespaces().declarePrefix(namespace.getPrefix(), namespace.getURI());
}
// set the input source with the correct encoding
InputSource source = new InputSource(reader);
source.setEncoding(wfs.getGeoServer().getGlobal().getCharset());
Object parsed = parser.parse(source);
// valid request? this should definitley be a configuration option
// TODO: HACK, disabling validation for transaction
if (!"Transaction".equalsIgnoreCase(getElement().getLocalPart())) {
if (!parser.getValidationErrors().isEmpty()) {
WFSException exception = new WFSException("Invalid request",
"InvalidParameterValue");
for (Iterator e = parser.getValidationErrors().iterator(); e.hasNext();) {
Exception error = (Exception) e.next();
exception.getExceptionText().add(error.getLocalizedMessage());
}
throw exception;