Skip to content

Commit 04af434

Browse files
amoiraudjaviereguiluz
authored andcommitted
erratum
1 parent c83e59d commit 04af434

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

components/serializer.rst

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -856,62 +856,6 @@ you indicate that you're expecting an array instead of a single object.
856856
857857
$data = ...; // The serialized data from the previous example
858858
$persons = $serializer->deserialize($data, 'Acme\Person[]', 'json');
859-
860-
The ``XmlEncoder``
861-
-----------------------
862-
863-
This encoder transforms arrays into XML and vice versa.
864-
865-
For example, take an object normalized as following::
866-
867-
array('foo' => array(1, 2), 'bar' => true);
868-
869-
The ``XmlEncoder`` will encode this object like that::
870-
871-
<?xml version="1.0"?>
872-
<response>
873-
<foo>1</foo>
874-
<foo>2</foo>
875-
<bar>1</bar>
876-
</response>
877-
878-
Be aware that this encoder will consider keys beginning with ``@`` as attributes::
879-
880-
$encoder = new XmlEncoder();
881-
$encoder->encode(array('foo' => array('@bar' => 'value')));
882-
// will return:
883-
// <?xml version="1.0"?>
884-
// <response>
885-
// <foo bar="value" />
886-
// </response>
887-
888-
Context
889-
~~~~~~~~~~~~~~~
890-
891-
The context param is an array of additional options for the XmlEncoder.
892-
It must be defined in the call of XmlEncoder encode() method :
893-
894-
$xmlEncoder->encode($array, 'xml', $context);
895-
896-
**Available params :**
897-
898-
``xml_format_output``
899-
If setted to true, format the output XML with line break and indentation
900-
901-
``xml_version``
902-
Change the XML version attribute
903-
904-
``xml_encoding``
905-
Change the XML encoding attribute
906-
907-
``xml_standalone``
908-
Add standalone attribute in XML output
909-
910-
``remove_empty_tags``
911-
If setted to true, remove all empty tags in the XML output
912-
913-
``xml_root_node_name``
914-
Change the root node name (default : response)
915859
916860
Recursive Denormalization and Type Safety
917861
-----------------------------------------

0 commit comments

Comments
 (0)