Changes

Jump to navigation Jump to search
710 bytes added ,  12:02, 18 October 2013
All errors are assigned to the {{Code|http://basex.org/errors}} namespace, which is statically bound to the {{Code|bxerr}} prefix.
==RulesConversion Formats==
The JSON conversion rules have been updated with {{Version|7.8}}:
===Direct Conversion===
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.
# Names (keys) of objects Object pairs are represented as via elements. The name of a pair is rewritten to an element name:## Empty names are represented by a single underscore ({{Code|_}}), 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 undercscoresunderscores. The resulting names are better readable, but cannot always may not be losslessly converted back to JSONtheir original form.# As the members of arrays have no names, Array entries are also represented via elements. {{Code|&lt;value/&gt;<_>}} is used as element name({{Code|value}} was used before {{Version|7.8}}).# JSON Object and array values are represented as stored in text nodes.# The types of values are represented in via {{Code|type}} attributes:## The value existing types are ''string'', ''number'', ''boolean'', ''null'', ''object'' , and ''array'' are represented by a {{Code|type}} attribute.## The ''As string'' type is omittedthe default, as it is treated as by default type.## If a name has the same type throughout the document, the {{Code|type}} attribute will be omitted. Instead, the name will be listed in additional, type-specific attributes in the root node. The attributes are named by their type in the plural (''numbers'', ''booleans'', ''nulls'', ''objects'' and ''arrays''), and the attribute value contains all names with that type, separated by whitespaces.
===Attributes Conversion===
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 string is the default, it is by default omitted.
 
...
 
## If a name has the same type throughout the document, the {{Code|type}} attribute will be omitted. Instead, the name will be listed in additional, type-specific attributes in the root node. The attributes are named by their type in the plural (''numbers'', ''booleans'', ''nulls'', ''objects'' and ''arrays''), and the attribute value contains all names with that type, separated by whitespaces.
==JsonML==
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu