Document toolboxDocument toolbox

Extended XML Specifications

As noted above, JSON provides a set of primitive types. XML does not provide such a mechanism. Therefore, below is the grammar used to represent these types in XML. To properly read this grammar, note that in instance:

  • NCName refers to a “non-colonized” name; that is, an XML element name without any namespace prefixing (see http://www.w3.org/XML/Schema.html for more). When used as the opening and closing of an element, it of course must follow XML standards and use the same name for the opening and closing tags.
  • Use = to denote the definition of a grammatical rule.
  • Use | to mean “or”.
  • Use [ ] indicates that the contents are optional.
  • Italics indicates a rule name, not literal text.
  • * indicates that the literal or rule-name that follows may be repeated 0 or more times.
  • Use ( ) for association.
  • / / indicates a Perl-style regular expression.
  • By default, the root element is treated as a hash and other elements as strings.
  • Example: foobar = foo *(, ( foo | bar) ) defines a rule, “foobar”, that validates a string that starts with “foo” and then is followed by “foo” and/or “bar” zero or more times, separated by commas (such as: “foo,bar,foo,foo,bar,foo,bar”).

Extended XML Grammar

object = <object-type> *name-value </object-type> | <NCName [ type="object-type" ]> *name-value </NCName>
name-value = <NCName [ type="type" ] [ nil="boolean" ]> value </NCName>
type = string | integer | int | float | boolean | bool | hash | array | object-type | nil
object-type = hash | model-type
model-type can be any of the models documented in Tools > Network > API Documentation.
value = string | integer | float | boolean | object | array | nil
string is a standard XML text node.
integer = /^[-+]?[0-9]+$/
float = /^[-+]?[0-9]+(\.[0-9]+)?$/
boolean = true | false
true = /^true$/i | /^yes$/i | y | Y | 1
false = /^false$/i | /^no$/i | n | N | 0
array = <array> *arrayvalue </array> | <NCName type="array"> *value </NCName>
arrayvalue = name-value(NCName="item")
nil = <nil/> | <NCName nil="true"/>