We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i got this xsd part:
<xsd:element name="EMAILS"> <xsd:complexType> <xsd:sequence maxOccurs="unbounded"> <xsd:element ref="EMAIL"/> <xsd:element ref="PUBLIC_KEY" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
my Problem is now that the sequence has maxOccurs="unbounded", so my first try was to put the sequence into its own class, and try to make it inline
maxOccurs="unbounded"
/** * @Serializer\XmlRoot("EMAILS") */ class Emails { /** * @Serializer\Expose * @Serializer\XmlList(inline = "true") * @Serializer\Inline * * @var EmailsInner[] */ protected array $inners = []; }
<?xml version="1.0" encoding="UTF-8"?> <EMAILS> <EMAIL><![CDATA[A]]></EMAIL> <EMAIL><![CDATA[B]]></EMAIL> </EMAILS>
<?xml version="1.0" encoding="UTF-8"?> <EMAILS> <entry> <EMAIL><![CDATA[A]]></EMAIL> </entry> <entry> <EMAIL><![CDATA[B]]></EMAIL> </entry> </EMAILS>
i assume it isn't just serializing but de-serializing too which should be affected by this?
and no i can't change the schema.
With PreSerialize i could add it to a list attribute to serialize it, but that causes it to be this:
<?xml version="1.0" encoding="UTF-8"?> <EMAILS> <entry><![CDATA[A]]></entry> <entry><![CDATA[KeyA]]></entry> <entry><![CDATA[B]]></entry> <entry><![CDATA[KeyB]]></entry> </EMAILS>
instead of this:
<?xml version="1.0" encoding="UTF-8"?> <EMAILS> <EMAIL><![CDATA[A]]></EMAIL> <PUBLIC_KEY><![CDATA[KeyA]]></PUBLIC_KEY> <EMAIL><![CDATA[B]]></EMAIL> <PUBLIC_KEY><![CDATA[KeyB]]></PUBLIC_KEY> </EMAILS>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps required to reproduce the problem
i got this xsd part:
my Problem is now that the sequence has
maxOccurs="unbounded"
,so my first try was to put the sequence into its own class, and try to make it inline
Expected Result
Actual Result
i assume it isn't just serializing but de-serializing too which should be affected by this?
and no i can't change the schema.
With PreSerialize
With PreSerialize i could add it to a list attribute to serialize it,
but that causes it to be this:
Actual Result
instead of this:
Expected Result
The text was updated successfully, but these errors were encountered: