Maybe RELAX NG would be a better fit for JSON validation? I haven’t looked inside any RNG validators, but I would be surprised if it was not relatively easy to bind the RNG pattern matching logic to JSON structures instead of XML structures. Or maybe a JSON-specific version of RELAX NG would make sense. But I guess you would still hit the issue that there is no well-defined mapping between JSON name-value pairs and semantic structures analogous to elements and attributes, so the utility would be limited to “If a map has this key, then it’s contained values must match this pattern”, which might still have significant utility. Cheers, Eliot -- Eliot Kimber http://contrext.com From: "Costello, Roger L." <costello@mitre.org> One of the purported advantages of JSON Schema is that it is simpler than XML Schema. After converting an XML Schema to JSON Schema, I am skeptical of such claims. In a previous post, I invited suggestions for converting an xs:complexType with mixed content to an equivalent JSON Schema. After assessing several approaches, I arrived at a JSON Schema representation. I represented the following xs:complexType <xs:complexType name="InternationalString" mixed="true"> with this JSON Schema: "InternationalString": { One could reasonably argue that the XML Schema representation is simpler. At the very least, it is shorter. The XML Schema that I converted has a second xs:complexType which extends the above xs:complexType with an attribute: <xs:complexType name="PedigreeStringType"> I believe this xs:complexType cannot be represented in JSON Schema. (If that is not correct, please let me know). The best that one can do is to copy the JSON Schema definition of "InternationalString" and add the version attribute: "PedigreeStringType": { As you know, the danger of copy-and-paste is that if the parent type (InternationalString) is changed, then I must ensure that the changes are also made wherever I did a copy-and-paste. Summary: I think it is probably true that JSON Schema is simpler than XML Schema for simple things. But for complex things, such as expressing mixed content and creating type hierarchies, I think XML Schema is simpler and more powerful. I welcome your comments. /Roger |