1

There is xmlencoder in symfony serializer, by using that we achive this.

$data = ['foo' => 'Foo value'];
$encoder = new XmlEncoder();
$encoder->encode($data, 'xml');

// is encoded as follows:
// <?xml version="1.0"?>
// <response>
//     <foo>
//        Foo value
//     </foo>
// </response>

Now we need to add <!DOCTYPE something like below

// is encoded as follows:
// <?xml version="1.0"?>
// <!DOCTYPE response SYSTEM "pathto.dtd">
// <response>
// .....

Is there a way to achieve this with symfony serializer?

gp_sflover
  • 3,460
  • 5
  • 38
  • 48
Kalhan.Toress
  • 21,683
  • 8
  • 68
  • 92

0 Answers0