Loading ...
Sorry, an error occurred while loading the content.

534Re: [json] A heavy-weight alternative to JSON : JSONML (a standard for fun)

Expand Messages
  • Justin Day
    Oct 11, 2006
    • 0 Attachment
      ---------- Forwarded message ----------
      From: Mert Sakarya <mertsakarya@...>
      Date: Oct 11, 2006 3:34 PM
      Subject: [json] A heavy-weight alternative to JSON : JSONML (a standard for
      To: json@yahoogroups.com

      Today, I thought of an XML representation for JSON and I came up with
      something like;

      //Sample JSONML xml file
      <?xml version="1.0" encoding="UTF-8"?>
      <Object xmlns=http://jsonml.org/1.0 xmlns:xsi="
      <Property Name="SimpleProperty">Any Text Here</Property>
      <Property Name="EmptyProperty"/>
      <Property Name="ObjectProperty">
      <Property Name="AnotherObjectProperty">value</Property>
      <Property Name="ArrayProperty">
      <Item>A text Item</Item>
      <Item>Jagged Array Item</Item>
      <Property Name="Property">An object in an array.</Property>
      <Property Name="Property1">Any Text Here</Property>

      //The xsd schema definition for JSONML (JSONML.xsd)
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="
      <xs:element name="Object" type="BaseObjectType"/>
      <xs:element name="Property" type="BasePropertyType" />
      <xs:element name="Array" type="BaseArrayType"/>
      <xs:element name="Item" type="BasePropertyType"/>

      <xs:complexType name="BaseArrayType">
      <xs:element ref="Item" minOccurs="0" maxOccurs="unbounded"/>
      <xs:complexType name="BasePropertyType" mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="Object"/>
      <xs:element ref="Array"/>
      <xs:complexType name="BaseObjectType">
      <xs:element ref="Property" minOccurs="0" maxOccurs="unbounded"/>
      <xs:attribute name="Name" use="optional"/>

      I hope, the indentation and fonts are displayed well on this message,
      because it took five (or more) minutes to format this message on Hotmail. I
      just realized that, I could type this message on some editor and paste
      later. Duh!

      Share your special moments by uploading 500 photos per month to Windows Live

      [Non-text portions of this message have been removed]

      [Non-text portions of this message have been removed]
    • Show all 3 messages in this topic