kewisch / sepa.js

Create and validate SEPA XML transactions
http://kewisch.github.io/sepa.js
Other
88 stars 61 forks source link

xml Document tag contains errors #19

Closed bizarrochris closed 7 years ago

bizarrochris commented 7 years ago

I'm using the module to create a sepa XML in node js. It works great and I got to an xml really fast.

However the document I get does not validate and also looks different from your example:

<Document xmlns="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02" xmlns:xmlns="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02 pain.008.003.02.xsd" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02">

To my knowledge the correct Tag would be:

<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02 pain.008.003.02.xsd">

Am I missing something or is this a bug that can be fixed inside the module? Thx in advance

Snap974 commented 7 years ago

Hi, anyone have some informations about this please?

@bizarrochris did you solved your problem please?

I have the same problem, I want to generate a SEPA XML Direct Debit.

Thanks, have a nice day

bizarrochris commented 7 years ago

@Snap974 The solution I found was replacing the wrong string with the right string hardcoded via string.replace()

Also I added: <?xml version="1.0" encoding="UTF-8"?> at the beginning, as some banks do need that

kewisch commented 7 years ago

Hey Folks, thanks for bringing this up. If you can fix the bug in the library I am happy to accept the PR. It looks like way too many xmlns are being generated there.

bizarrochris commented 7 years ago

@kewisch Hi Philipp, I created a PR for fixing the code. Would be great if you could merge it, and also publish a new version to NPM. Cheers