From d649179159b8cab0e313f2410428fe07591d25b2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 6 Aug 2025 15:22:16 +0200 Subject: [PATCH] [Serializer] Add CDATA_WRAPPING_NAME_PATTERN support to XmlEncoder --- serializer/encoders.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/serializer/encoders.rst b/serializer/encoders.rst index 8238d4d057d..c3fb2e26b50 100644 --- a/serializer/encoders.rst +++ b/serializer/encoders.rst @@ -205,6 +205,10 @@ These are the options available on the :ref:`serializer context &]/``) A regular expression pattern to determine if a value should be wrapped in a CDATA section. +``cdata_wrapping_name_pattern`` (default: ``false``) + A regular expression pattern that defines the names of fields whose values + should always be wrapped in a CDATA section, even if their contents don't + require it. Example: ``'/(firstname|lastname)/'`` ``ignore_empty_attributes`` (default: ``false``) If set to true, ignores all attributes with empty values in the generated XML @@ -216,6 +220,10 @@ These are the options available on the :ref:`serializer context