Open NathanaelSantos opened 1 year ago
I found another solution :
in goetas-webservices/xsd2php/src/DependencyInjection/Configuration.php
replace this code segment :
->arrayNode('configs_jms')
->addDefaultsIfNotSet()
->children()
->booleanNode('xml_cdata')
->defaultTrue()
->end()
->end()
->end()
to :
->arrayNode('configs_jms')
->addDefaultsIfNotSet()
->children()
->booleanNode('xml_cdata')
->defaultFalse()
->end()
->end()
->end()
As change default from true to false.
Vlw 👍 fklee
I found a solution here: https://jmsyst.com/libs/serializer/master/reference/annotations
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\XmlElement;
class MyClass
{
/**
* @var \DateTime $data
* @Type("DateTime<'Y-m-d'>")
* @XmlElement(cdata=false)
*/
private $data = null;
}
In my config.yml:
The generated XML:
It appears that despite setting xml_cdata to false, the XML still contains CDATA sections. This could be a bug in the library "goetas-webservices/xsd2php" ?