dmitrirussu / php-sepa-xml-generator

SEPA SDD XML Generator recommended to see. PHP SEPA XML Generator, (Single Euro Payments Area ISO20022 SDD V1_0 20122009) (SEPA)(PHP5)
https://github.com/dmitrirussu/PHP-SEPA-XML-GENERATOR
MIT License
53 stars 36 forks source link

about the structure of SEPA Credit Transfer #27

Closed LioCodebio closed 8 years ago

LioCodebio commented 8 years ago

Having to Generate SEPA Credit Transfer's XMLs, I ran into some structure issues when I tried to validate them:

Finally, I found very usefull the possibility to save the xml generated as a text, by modifying XMLGenerator::save() as such: /* * Save Xml File * @param string $stream * @param null $fileName * @return bool|mixed / public function save($stream, $fileName = null) { $dom = new \DOMDocument('1.0'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true;

        if ( !$this->xml->children() ) {

                $this->generateMessages();
                $dom->loadXML($this->xml->asXML());
        }
        else {

                $dom->loadXML($this->getGeneratedXml());
        }
        if ( $stream == "file" && $fileName ) {
            return ($dom->save($fileName) ? true : false);
        }
        elseif ($stream == "text")
            return $dom->saveXML ();
        return $this;
}
dmitrirussu commented 8 years ago

Thanks for your request I have append all changes for credit transfer now it correspond with documentation.