Re: [xml-dev] Best options for converting JSON to XML

From
John Cowan <>
To
David Lee <>
Date
2013-11-11T19:33:35Z
ID
<CABzTEQDD7p6UWb6OfiFKwHb-hqyVv34CP=>
Thread
Re: [xml-dev] Best options for converting JSON to XML



On Sun, Nov 10, 2013 at 9:59 AM, David Lee <[email protected]> wrote:

"For every member element with an attribute named 'name' with a value "a json name" it must have a single child
element "value" with a "type" attribute  with the value "Number" and its text contents must follow the constraints of xs:decimal

This is difficult or impossible to express in common XML schema languages

It's straightforward in RNG.  Compact syntax version:

define a-json-name = element * {
  attribute name { "a json name" },
  element value {
    attribute type { "Number"},
    xs:decimal
  }
}

It's really only DTDs and XSD 1.0 that can't cope with this sort of thing.

--
GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures