Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create MxPain00800102 message with schemaLocation in Document element #103

Closed
hellectronic opened this issue Sep 18, 2023 · 3 comments
Closed
Assignees
Labels
help wanted Extra attention is needed

Comments

@hellectronic
Copy link

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="https://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
Copy link
Author

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
Copy link
Member

zubri commented Jan 30, 2024

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 zubri added the help wanted Extra attention is needed label Jan 30, 2024
@zubri zubri self-assigned this Jan 30, 2024
@hellectronic
Copy link
Author

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

@zubri zubri closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants