Symfony\Component\Serializer\Encoder\XmlEncoder
Encodes XML data
- Author: Jordi Boggiano <j.boggiano@seld.be>
Synopsis
class XmlEncoder
extends SerializerAwareEncoder
implements
EncoderInterface,DecoderInterface,NormalizationAwareInterface
{
- // members
- private $dom;
- private $format;
- private string $rootNodeName;
- // Inherited members from SerializerAwareEncoder
- protected $serializer;
- // methods
- public void __construct()
- public void encode()
- public void decode()
- public Boolean supportsEncoding()
- public Boolean supportsDecoding()
- public void setRootNodeName()
- public string getRootNodeName()
- protected final Boolean appendXMLString()
- protected final Boolean appendText()
- protected final Boolean appendCData()
- protected final Boolean appendDocumentFragment()
- protected final Boolean isElementNameValid()
- private array parseXml()
- private Boolean buildXml()
- private Boolean appendNode()
- private Boolean needsCdataWrapping()
- private Boolean selectNodeType()
- private void resolveXmlRootName()
- // Inherited methods from SerializerAwareEncoder
- public void setSerializer()
Hierarchy
Extends
Implements
Members
private
- $dom
- $format
- $rootNodeName
protected
- $serializer
Methods
private
- appendNode() — Selects the type of node to create and appends it to the parent.
- buildXml() — Parse the data and convert it to DOMElements
- needsCdataWrapping() — Checks if a value contains any characters which would require CDATA wrapping.
- parseXml() — Parse the input SimpleXmlElement into an array.
- resolveXmlRootName() — Get real XML root node name, taking serializer options into account.
- selectNodeType() — Tests the value being passed and decide what sort of element to create
protected
- appendCData()
- appendDocumentFragment()
- appendText()
- appendXMLString()
- isElementNameValid() — Checks the name is a valid xml element name
public
- __construct() — Construct new XmlEncoder and allow to change the root node element name.
- decode() — {@inheritdoc}
- encode() — {@inheritdoc}
- getRootNodeName() — Returns the root node name
- setRootNodeName() — Sets the root node name
- supportsDecoding() — Checks whether the serializer can decode from given format
- supportsEncoding() — Checks whether the serializer can encode to given format
Inherited from Symfony\Component\Serializer\Encoder\SerializerAwareEncoder
public
- setSerializer() — {@inheritdoc}