Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BPMN Modeler » BPMN model validation(how to validate bpmn model xmi?)
BPMN model validation [message #536343] Thu, 27 May 2010 17:18 Go to next message
Giuseppe Ciulla is currently offline Giuseppe CiullaFriend
Messages: 3
Registered: November 2009
Junior Member

I'm new in this forum.

I have to perform validation of .bpmn files with xml schema or in other way.

How can I do this?

I run this code:

	try {
      // define the type of schema - we use W3C:
      String schemaLang = "";

      // get validation driver:
      SchemaFactory factory = SchemaFactory.newInstance(schemaLang);

      // create schema by reading it from an XSD file:
      Schema schema = factory.newSchema(new StreamSource(new File("bpmnXMI.xsd")));
      Validator validator = schema.newValidator();

      // at last perform validation:
      validator.validate(new StreamSource(new File("bpmnModelTest.bpmn")));
    }catch (SAXException ex) {
    } catch (Exception ex) {

and this is the result:

org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'xmi:version' is not allowed to appear in element 'bpmn:BpmnDiagram'.
	at Source)
	at Source)
	at Source)
	at Source)
	at$XSIErrorReporter.reportError(Unknown Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at$NSContentDriver.scanRootElementHook(Unknown Source)
	at$ Source)
	at$ Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source)
	at javax.xml.validation.Validator.validate(Unknown Source)
	at it.eng.rspa.validator.Test.main(

I generate "bpmnXMI.xsd" from the "bpmn.genmodel" by the command "Generator -> Export Model" and selecting "XML schema for XMI"

Re: BPMN model validation [message #539439 is a reply to message #536343] Thu, 10 June 2010 17:47 Go to previous message
Antoine Toulmé is currently offline Antoine ToulméFriend
Messages: 31
Registered: July 2009
1. Go ahead and use XMLUnit for your XML validation needs. It works well for me.

2. Not sure what you are trying to do - this bpmnXMI.xsd doesn't match the bpmn.xsd file name we use in the bpmn modeler.


Previous Topic:Several Outgoing Edges
Next Topic:Cannot open diagrams with old version that were created by a new version
Goto Forum:

Current Time: Mon Oct 24 18:46:55 GMT 2016

Powered by FUDForum. Page generated in 0.04053 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software