PHP Класс FluentDOM\Serializer\Json

Using this on a standard XML document will ignore a lot of data. Namespaces and Attributes are ignored, if here are two elements with the same name only the last will be in the output. If an element has child elements, all text child nodes will be ignored. See the other serializers, to keep this data. This serializer recognizes attributes from the JsonDOM namespaces. If you import an JSON to a DOM in FluentDOM, the additional information is stored in these attributes (types, names, ...) Here is a example of an XML: true 42 Foo <_ json:type="number">21
Наследование: implements JsonSerializable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_node DOMNode

Открытые методы

Метод Описание
__construct ( DOMNode $node, integer $options, integer $depth = 512 )
__toString ( ) : string
jsonSerialize ( ) : mixed

Защищенные методы

Метод Описание
getEmpty ( ) : mixed
getNamespaces ( DOMElement $node ) : array Get the namespace definitions needed for this node.
getNode ( DOMElement $node ) : mixed

Приватные методы

Метод Описание
getAllNamespaces ( DOMElement $node ) : array
getChildElements ( DOMElement $source ) : DOMNodeList
getName ( DOMElement $node ) : string
getType ( DOMElement $node ) : string

Описание методов

__construct() публичный Метод

public __construct ( DOMNode $node, integer $options, integer $depth = 512 )
$node DOMNode
$options integer
$depth integer

__toString() публичный Метод

public __toString ( ) : string
Результат string

getEmpty() защищенный Метод

protected getEmpty ( ) : mixed
Результат mixed

getNamespaces() защищенный Метод

If compares the namespaces of the current node with the ones from the parent node. Only definitions that are different are returned.
protected getNamespaces ( DOMElement $node ) : array
$node DOMElement
Результат array

getNode() защищенный Метод

protected getNode ( DOMElement $node ) : mixed
$node DOMElement
Результат mixed

jsonSerialize() публичный Метод

public jsonSerialize ( ) : mixed
Результат mixed

Описание свойств

$_node защищенное свойство

protected DOMNode $_node
Результат DOMNode