phax / ph-ubl

Java library for reading and writing UBL 2.0, 2.1, 2.2, 2.3 and 2.4 documents
Apache License 2.0
110 stars 40 forks source link

Failed to add multiple scheme ID with value in PartyIdentificationType for UBL 2.1 version 9.0.0 #62

Closed soowc closed 7 months ago

soowc commented 7 months ago

Hi,

Sorry for disturb. Encountered issue when wanted to add multiple ID in PartyIdentificationType. Checked and there is no addID in PartyIdentificationType library. Am I doing correctly on this?

final PartyIdentificationType aIdentification = new PartyIdentificationType();
IDType aID = new IDType();
aID.setSchemeID("TIN");
aID.setValue("TINNo1");

IDType bID = new IDType();
bID.setSchemeID("NRIC");
bID.setValue("NRICNo1");

aIdentification.setID(aID);
aIdentification.setID(bID);

System.out.println("aIdentification ::: "+aIdentification.toString());

Output: id=[IDType@0x1ed4004b: schemeAgencyID=null; schemeAgencyName=null; schemeDataURI=null; schemeID=NRIC; schemeName=null; schemeURI=null; schemeVersionID=null; value=NRICNo1]]

phax commented 7 months ago

~Hi. Don't call setID but addID.~

Edit: You can only have one ID element inside PartyIdenticiation - the XSD doesn't allow more.

soowc commented 7 months ago

Hi,

Thank you for clarifying. The sample output I received, which included multiple rows of ID in Party Identification, prompted the question.

This clarification has been immensely helpful, and I'm delighted on the library is working smoothly for me. Thank you!