pimviewer.clearLineColors();
output.addLine("Validation : initializing");
Validator theValidator = new Validator(output);
XmiSchema theSchema = new DOMXmiSchema(UMTMain.resource_dir + "extxmi.xsd");
PropertyGroup theProfile = profileeditor.getChosenProfile();
Profile2XSD transformer = new Profile2XSD();
try{
DocumentBuilderFactory theFact = DocumentBuilderFactory.newInstance();
DocumentBuilder bobTheBuilder = theFact.newDocumentBuilder();
InputSource toParse = new InputSource(new StringReader(pimviewer.getHutnBuffer()));
Document theModel = bobTheBuilder.parse(toParse);
theSchema = transformer.doTransformation(theProfile,theModel);
String theProfileName = "No profile selected.";
if (theProfile != null)
theProfileName = theProfile.getName();
if (theProfileName == null || theProfileName.equals(""))
theProfileName = "(no profile)";
output.addLine("Validation : starting validation. Profile = " + theProfileName);
theValidator.validateAgainstSchema(theModel,theSchema);
output.addLine("Validation : validation done") ;