{
//Get a reader from the given string
Reader reader = getReaderFromString(sldBody);
//-InputStream in = new StringBufferInputStream(sldBody);
// user requested to validate the schema.
SLDValidator validator = new SLDValidator();
List errors =null;
//Create a sax input source from the reader
InputSource in = new InputSource(reader);
errors = validator.validateSLD(in, request.getHttpServletRequest().getSession().getServletContext());
if (errors.size() != 0) {
reader = getReaderFromString(sldBody);
throw new WmsException(SLDValidator.getErrorMessage(reader, errors));
}
//- errors = validator.validateSLD(in, request.getHttpServletRequest().getSession().getServletContext());