Changes

Jump to navigation Jump to search
No change in size ,  13:33, 18 October 2013
The {{Code|direct}} conversion format allows a lossless conversion from JSON to XML and back. The transformation is based on the following rules:
# * The resulting document has a {{Code|<json>}} root node. # * Object pairs are represented via elements. The name of a pair is rewritten to an element name:## ** Empty names are represented by a single underscore ({{Code|_}}), existing . Existing underscores are rewritten to two underscores ({{Code|__}}), and characters that are not valid in element names are rewritten to an underscore and the character’s four-digit Unicode.## ** If the {{Code|lax}} option is set to {{Code|false}}, invalid characters are simply replaced with underscores. The resulting names are better readable, but may not be losslessly converted back to their original form.# * Array entries are also represented via elements. {{Code|<_>}} is used as element name (before {{Version|7.8}}, the element was named {{Code|<value>}}).# * Object and array values are stored in text nodes.# * The types of values are represented via {{Code|type}} attributes:## ** The existing types are ''string'', ''number'', ''boolean'', ''null'', ''object'', and ''array''.## ** As most values are strings, the ''string'' type is by default omitted.
===Attributes===
The {{Code|attributes}} format is lossless, too. The transformation based on the following rules:
# * The resulting document has a {{Code|<json>}} root node. # * Object pairs are represented via {{Code|<pair>}} elements. The name of a pair is stored in a {{Code|name}} attribute.# * Array entries are represented via {{Code|<item>} elements.# * Object and array values are stored in text nodes.# * The types of values are represented via {{Code|type}} attributes:## ** The existing types are ''string'', ''number'', ''boolean'', ''null'', ''object'', and ''array''.## ** As most values are strings, the ''string'' type is by default omitted.
===JsonML===
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu