In previous examples of your XML I noticed that you have the n1 prefix defined in both the root element and the element that is giving you problems. My guess is that the XML that is giving you issues doesn't have the redefinition in the pdBranchCustomerNotification element, so it uses the definition from the root element.
 In the InfoMessageBroker-v2016.xsd, add the import (add path to the schemaLocation, if necessary) and modify the root. This is the first two lines followed by the definition of the element EventMessage as written in your original xsd.
 Then inside the same schema, change the type to the EventBody line
 Furthermore, to reinforced validation, you should really change the processContents attribute from skip to lax, or preferrably to strict, since you take the trouble to construct the schema for the namespace pbn surely for a purpose, and to import it.
[3.1] If you keep the processContents skip, you don't even need to import the PDNotification-20180914.xsd into InfoMessageBroker-v2016.xsd and the validation of the message will go through without any problem at that level already.
I followed the steps but now I am getting this error when trying to generate the java pojos from the changed xsd "InfoMessageBroker-v2016.xsd"
parsing a schema...
[ERROR] src-resolve: Cannot resolve the name 'pdn:EventBodyType' to a(n) 'type definition' component.
line 18 of file:/C:/Users/dharkhu/eclipse/temp/myTest/TestJAXB/src/InfoMessageBroker-v2016.xsd
This is because EventBodyType is not defined inside "PDNotification-20180914.xsd"
Let me see. In my section , I was referring to the schema of Broker using xs:any and xs:anyAttribute shown in your other thread 702056 that I was reading.
In the present thread here, you are not using that kind of constructions. It is fine, but the answer needs some adjustment. Here is how.
You've already import the Notification schema, prefixed tns (which I was referring as pbn in ). Though you can do that but it is kind of confusing as tns commonly referring to targetNamespace. Ok, I take it as you have written, fine. So to answer to the problem in the schema set as presented in this thread (rather than referring to that in 702056), this is the complete rundown of modifications.
[I] Change the corresponding lines here.
and it seems to be enough.
For my previous posts, sections ,  (amended) and , all apply to your other thread 702056, with xs:any and xs:anyAttribute constructions. I hope this is clearer now.
Thanks now I am able to unmarshall the xml (without doing schema validation), but when I am trying to validate the xml by creating the schema object from the InfoMessageBroker-v2016.xsd and setting it into the Unmarshaller object, it is giving me following error
My main method is as below
The error which I am getting while trying to unmarshal with schema validation.