prowide / prowide-iso20022

Comprehensive business model and parser for all ISO 20022 messages
https://www.prowidesoftware.com
Apache License 2.0
142 stars 66 forks source link

Create MxPain00800102 message with schemaLocation in Document element #103

Closed hellectronic closed 3 months ago

hellectronic commented 12 months ago

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 commented 11 months ago

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);
zubri commented 7 months ago

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.

hellectronic commented 7 months ago

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