Khuzema Dharwala

Ranch Hand
+ Follow
since Apr 26, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Khuzema Dharwala

Hi All,

I have list of String objects defined as List<String> and I want to split this List into sublist such that each sublist should be of length <=6 and number of chars in each sublist should not exceed 240 chars.

Any idea how to achieve this in java 8 ?

Special condition : If the total no. of chars in the sublist exceeds 240 chars then we have to decrease the no. of elements in the sublist such that it meets the length of 240 and shift the rest elements in next sublist and so on.

Regards,
Khuzema
5 years ago
Hi Tsuji,

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.





Thanks tsuji,

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"
Hi Stephan

'pdBranchCustomerNotification' is defined in the xsd PDNotification-20180914.xsd having targetNameSpace = "http://www.example.org/PDNotification" but unmarshaller is not taking it.

I am using jrocket 1.6 which has jaxb implementation  vJAXB 2.1.10
Hi Rob,

Now I am getting following error when I am trying to unmarshal the xml

Not sure why it is looking for pdBranchCustomerNotification in namespace "http://www.db.com/2016/InfoMessageBroker/Types"


PDNotification-20180914.xsd is

InfoMessageBroker-v2016.xsd is

Hi All,

Following are the two xsds and an xml message I have

InfoMessageBroker-v2016.xsd
PDNotification-20180914.xsd
BranchCustomerNotifcation.xml

I want to unmarshall the ml message using jaxb 2.1 implementation, InfoMessageBroker xsd has a complexType "EventBodyType" which contains the message body but it has generic declaration like below

The problem is how I can import PDNotification xsd in InfoMessageBroker xsd and change the EventBodyTag defination so that the xml message can be correctly unmarshall and gives me populated java object BranchCustomerNotificationType






The xml message is


Attaching the second xsd file

PDNotification-20180914.xsd

6 years ago
Attaching the first xsd file

InfoMessageBroker-v2016.xsd

6 years ago
Hello All,

I am facing issue while unmarshalling the xml file using below code




Getting following error while running the code




The xml file is

6 years ago
This is the xsd files

PDNotification-20180914.xsd

6 years ago
Hi All,

I am facing issue while unmarshalling an xml to create the corresponding java object




On running the above program, I am getting below error

6 years ago