File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 3030{
3131 public const DOC_TYPE_VERSION = '1.2.063 ' ;
3232
33- private function __construct (private SerializerInterface $ jmsSerializer )
34- {
35- }
33+ private function __construct (
34+ private SerializerInterface $ jmsSerializer ,
35+ private string $ dtdUri = 'http://xml.cxml.org/schemas/cXML/ ' . self ::DOC_TYPE_VERSION . '/cXML.dtd '
36+ )
37+ {}
3638
3739 public static function create (): self
3840 {
@@ -71,11 +73,11 @@ public function deserialize(string $xml): CXml
7173 return $ this ->jmsSerializer ->deserialize ($ xml , CXml::class, 'xml ' );
7274 }
7375
74- public function serialize (CXml $ cxml, string $ docTypeVersion = self :: DOC_TYPE_VERSION ): string
76+ public function serialize (CXml $ cxml ): string
7577 {
7678 $ xml = $ this ->jmsSerializer ->serialize ($ cxml , 'xml ' );
7779
78- $ docType = '<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/ ' . $ docTypeVersion . ' /cXML.dtd "> ' ;
80+ $ docType = '<!DOCTYPE cXML SYSTEM " ' . $ this -> dtdUri . ' "> '. "\n" ;
7981 $ xmlPrefix = '<?xml version="1.0" encoding="UTF-8"?> ' ;
8082
8183 // add doctype, as it is mandatory in cXML
You can’t perform that action at this time.
0 commit comments