Skip to content

Commit c4aecf4

Browse files
pyatnitsevjaviereguiluz
authored andcommitted
add example
Add an example serialization of node with attribute and value in same time
1 parent db70285 commit c4aecf4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

components/serializer.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,18 @@ The array keys beginning with ``@`` are considered XML attributes::
903903
// <foo bar="value" />
904904
// </response>
905905

906+
If you want create a node with value and attribute use this::
907+
908+
array('foo' => array('@bar' => 'value', # => 'baz'));
909+
910+
// is encoded as follows:
911+
// <?xml version="1.0"?>
912+
// <response>
913+
// <foo bar="value">
914+
// baz
915+
// </foo>
916+
// </response>
917+
906918
Context
907919
~~~~~~~
908920

0 commit comments

Comments
 (0)