Skip to content

Commit

Permalink
feature #19883 [Serializer] Add missing XML serializer's CDATA option…
Browse files Browse the repository at this point in the history
…s (alexpozzi)

This PR was merged into the 7.1 branch.

Discussion
----------

[Serializer] Add missing XML serializer's CDATA options

Fixes #19851

Commits
-------

c6d3512 Add missing XML serializer's CDATA options
  • Loading branch information
OskarStark committed May 16, 2024
2 parents 697b047 + c6d3512 commit 4a052d5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1200,11 +1200,17 @@ Option Description
``remove_empty_tags`` If set to true, removes all empty tags in the ``false``
generated XML
``cdata_wrapping`` If set to false, will not wrap any value ``true``
containing one of the following characters (
``<``, ``>``, ``&``) in `a CDATA section`_ like
following: ``<![CDATA[...]]>``
matching the ``cdata_wrapping_pattern`` regex in
`a CDATA section`_ like following:
``<![CDATA[...]]>``
``cdata_wrapping_pattern`` A regular expression pattern to determine if a ``/[<>&]/``
value should be wrapped in a CDATA section
============================== ================================================= ==========================

.. versionadded:: 7.1

The `cdata_wrapping_pattern` option was introduced in Symfony 7.1.

Example with custom ``context``::

use Symfony\Component\Serializer\Encoder\XmlEncoder;
Expand Down

0 comments on commit 4a052d5

Please sign in to comment.