prowide-iso20022 icon indicating copy to clipboard operation
prowide-iso20022 copied to clipboard

Create MxPain00800102 message with schemaLocation in Document element

Open hellectronic opened this issue 1 year ago • 3 comments

Hello,

is it possible to add a schmemaLocation to the Document element? E.g. at the moment I get <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"> my goal is to get <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02 pain.008.001.02.xsd">

Best regards George

hellectronic avatar Sep 18 '23 15:09 hellectronic

My simple workaround is to replace the Document-tag in the resulting message string.

String document = value.document(writeParams);
String updatedDocument = document.replaceFirst(PAIN_DOCUMENT_TAG, PAIN_DOCUMENT_TAG_UPDATED);

hellectronic avatar Oct 20 '23 09:10 hellectronic

Notice for validation purposes you can use a SchemaFactory, and create a Validator for the specific schema. There is no need to modify the actual XML payload to validate it.

zubri avatar Jan 30 '24 22:01 zubri

Thank you for your comment. My use case is to generate a document with this tags because the service processing the XML needs them.

hellectronic avatar Jan 31 '24 19:01 hellectronic