Hi Folks, I am converting an XML Schema to a JSON Schema. The XML Schema declares an <example> element that has bidirectional-override (BDO) elements intermingled with text, e.g., <example>Some
text <bdo
dir="rtl">reverse
this text <bdo
dir="ltr">not
this text</bdo></bdo>
finishing text</example> rtl = right-to-left
ltr = left-to-right
As you can see, the <example> element has mixed content, as does the <bdo> element. At the bottom of this message is the XML Schema. JSON and JSON Schema do not support mixed content, nor do they support attributes. How to represent the XML in JSON and JSON Schema? Here’s what I am thinking: Mixed content is essentially an ordered sequence of text, element, text, element, … JSON arrays are intended to represent ordered sequences. So, I am thinking that mixed content can be represented in JSON with an array. The above
<example> element can be expressed this way in JSON: { Notice that the content of the items with mixed content (example and bdo) are represented with arrays. At the bottom of this message is the JSON Schema. Is there a better way to represent mixed content in JSON? What makes one way better than another? One way can be processed easier, more efficiently
than another? /Roger XML Schema <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
JSON Schema { |