Browse Source

Updated documentation

Miha Vrhovnik 11 years ago
parent
commit
787014d065
3 changed files with 28 additions and 0 deletions
  1. 25 0
      doc/reference/annotations.rst
  2. 1 0
      doc/reference/xml_reference.rst
  3. 2 0
      doc/reference/yml_reference.rst

+ 25 - 0
doc/reference/annotations.rst

@@ -398,6 +398,8 @@ Resulting XML:
 This allows you to mark properties which should be set as the value of the
 current element. Note that this has the limitation that any additional
 properties of that object must have the @XmlAttribute annotation.
+XMlValue also has property cdata. Which has the same meaning as the one in
+XMLElement.
 
 .. code-block :: php
 
@@ -508,3 +510,26 @@ Resulting XML:
 .. code-block :: xml
 
     <result name="firstname" value="Adrien"/>
+
+@XmlElement
+~~~~~~~~
+This annotation can be defined on a property to add additional xml serialization/deserialization properties.
+
+.. code-block :: php
+
+    <?php
+    use JMS\Serializer\Annotation\XmlElement;
+
+    class User
+    {
+        /**
+        * @XmlElement(cdata=false)
+        */
+        private $id = 'my_id;
+    }
+
+Resulting XML:
+
+.. code-block :: xml
+
+    <id>my_id</id>

+ 1 - 0
doc/reference/xml_reference.rst

@@ -32,6 +32,7 @@ XML Reference
                 <type><![CDATA[]]></type>
                 <xml-list inline="true" entry-name="foobar" />
                 <xml-map inline="true" key-attribute-name="foo" entry-name="bar" />
+                <xml-element cdata="false" />
             </property>
             <callback-method name="foo" type="pre-serialize" />
             <callback-method name="bar" type="post-serialize" />

+ 2 - 0
doc/reference/yml_reference.rst

@@ -42,6 +42,8 @@ YAML Reference
                     key_attribute_name: foo
                     entry_name: bar
                 xml_attribute_map: true
+                xml_element:
+                    cdata: false
                 max_depth: 2
 
         handler_callbacks: