Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

json · JSON JavaScript Object Notation

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 590
  • Category: Data Formats
  • Founded: Jul 19, 2005
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 1505 - 1535 of 1958   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#1505 From: "stephen.mckamey" <stephen@...>
Date: Tue Apr 6, 2010 5:11 pm
Subject: Re: Where our JSON product is heading: XML to JSON and Back
stephen.mckamey
Send Email Send Email
 
JsonML ( http://jsonml.org ) handles all of these issues and has been embraced
by quite a number of places. Many JSON encoders already include support.

It handles namespaces the same way that XML 1.0 did: include the name as
"prefix:local-name" and the URI to prefix mapping
(xmlns:abc="http://example.com/abc") as the attribute of the node that declared
it.

An early implementation of JsonML took a similar approach to including a child
object, but ultimately after some design discussions with Douglas Crockford, his
suggestion was to make the actual element an array like the child object and
have the element name be the first item.

This positional structure has been the biggest part that people have disliked
about JsonML, but yet in many XML documents (XHTML for example, being the
primary use case) position of the child nodes is critical to the meaning of the
document. So you get much smaller documents when you just add the element name
as the first child and make elements arrays.

I'd encourage you to embrace JsonML and contribute to a standard that has been
around for four years already rather than creating a slightly different
approach.


--- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
>
> For people interested in this topic.   We are always open to comments and
questions.
>
> https://www.p6r.com/articles/2010/04/05/xml-to-json-and-back/
>
>
> Best,
>
> Mark Joseph, Ph.D.
> President
> P6R, Inc
> 408-205-0361
> mark@...
> Skype: markjoseph_sc
>
>
>
> [Non-text portions of this message have been removed]
>

#1506 From: "stephen.mckamey" <stephen@...>
Date: Tue Apr 6, 2010 5:20 pm
Subject: Re: SV: JSON representation for XML snippet
stephen.mckamey
Send Email Send Email
 
Not that ugly:

["node1", {"a":"45"},
      ["node2", {"b":"9", "c":"hithere"},
          ["node3", {"d":"abc"},
             ["node4", {"e":"12345"}, "JSON has no attributes"]
          ]
      ],
      "Now is the time for all good men to come to the aid of their party",

      ["node5", {"d":"45"}, "temperature is 70 degrees today"]
]

--- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
>
>
> Handling XML attributes when converting to JSON:
> **************************************
> <attribute a2="v2">value2</attribute>
> will be
> {"attribute":{"a2":"v2"},"#text":"value2"}
>
> as example ... while JSONML uses this kind of schema
>
> ["nodeName",{"a2":"v2"},"text or nested nodes"]
>
> so that this:
>
> <attributes>
>    <attribute a2="v2">value2</attribute>
> </attributes>
>
> will be this
>
> ["attributes",{},["attribute",{"a2":"v2"},"value2"]]
>  ****************************************
>
> So all of the above works well when you have simple XML.
> But with something like:
>
> <node1 a="45">
>     <node2 b="9" c="hithere">
>         <node3 d="abc">
>            <node4 e="12345">JSON has no attributes</node4>
>         </node3>
>     </node2>
>     Now is the time for all good men to come to the aid of their party
>
>     <node5 d="45">temperature is 70 degrees today</node5>
> </node1>
>
> The resulting JSON is going to be "ugly".   Many added arrays
> are added to handle the attributes and nested nodes now appear in the
> added arrays.   To me this adds a lot of extra complexity that I am
> not sure I want.
>
>
>
> Best,
> Mark Joseph, Ph.D.
> P6R, Inc
>

#1507 From: John Cowan <cowan@...>
Date: Tue Apr 6, 2010 6:14 pm
Subject: Re: Digest Number 597
johnwcowan
Send Email Send Email
 
Alan Kennedy scripsit:

> On reading your article, I saw reference to several existing methods
> for mapping XML<->JSON. But I didn't see any reference to the Google
> XML<->JSON mapping, as described in this article.
>
> Using JSON in the Google Data Protocol
> http://code.google.com/apis/gdata/docs/json.html

Note that Google has announced a different, non-round-tripping,
JSON syntax called JSONC for two of its Google Data APIs, YouTube and
PicasaWeb.  JSONC is not a general conversion strategy, but a per-API
one that is designed to make the service more accessible to people who
prefer consuming APIs with JSON.  There is an experimental Java client
which uses per-service descriptions to consume JSON appropriately.

> Looking at the examples you give about mixed-content elements, I can
> see that Google have punted on this issue, i.e. they represent
>
> <content type="text">Google is sponsoring at
>       <a href="http://www.pubcon.com/">WebmasterWorld PubCon 2006</a>. Come
and
>       visit us at the booth or join us for an evening demo reception where we
>       will be talking "5 ways to enhance your website with Google Code".
>       After all, it is Vegas, baby! See you soon.</content>

In this case, the Atom content type is "text", which means that although
this appears to be HTML, it is treated as plain text by the API.
Any further interpretation is up to the client.

> In this case, the inline <a/> element is left in XML format, and not
> translated to JSON.

That's because it's not seen as an element at all.

Disclaimer: Although I work for Google (and in fact belong to the
Google Data APIs team), I am not telling you anything that isn't public
knowledge.  Any forward-looking conclusions you draw are entirely up
to you.

--
At the end of the Metatarsal Age, the dinosaurs     John Cowan
abruptly vanished. The theory that a single         cowan@...
catastrophic event may have been responsible        http://www.ccil.org/~cowan
has been strengthened by the recent discovery of
a worldwide layer of whipped cream marking the
Creosote-Tutelary boundary.             --Science Made Stupid

#1508 From: "Mark Joseph" <mark@...>
Date: Tue Apr 6, 2010 6:19 pm
Subject: Re: Re: Where our JSON product is heading: XML to JSON and Back
markjoseph_sc
Send Email Send Email
 
Cool stuff, can you show me an example of how JsonML handles XML mixed content,
that is not clear to me from the web site.


And just so it is clear to me, the namespace example would be something like:

<description abc="http://example.com"><abc:title>hi
there</abc:title></description>

becomes

[ "description", {"abc" : "http://example.com"},
         [ "abc:title", {}, "hi there" ]
]

So the JSON application has to find the meaning of "abc:title", if it cares,
like XML applications do by looking for the first enclosing element with
a definition for "abc"?



Thanks,

Mark Joseph, Ph.D.
President
P6R, Inc
408-205-0361
mark@...
Skype: markjoseph_sc
   _____

From: stephen.mckamey [mailto:stephen@...]
To: json@yahoogroups.com
Sent: Tue, 06 Apr 2010 10:11:22 -0700
Subject: [json] Re: Where our JSON product is heading: XML to JSON and Back








   JsonML ( http://jsonml.org ) handles all of these issues and has been embraced
by quite a number of places. Many JSON encoders already include support.

   It handles namespaces the same way that XML 1.0 did: include the name as
"prefix:local-name" and the URI to prefix mapping
(xmlns:abc="http://example.com/abc") as the attribute of the node that declared
it.

   An early implementation of JsonML took a similar approach to including a child
object, but ultimately after some design discussions with Douglas Crockford, his
suggestion was to make the actual element an array like the child object and
have the element name be the first item.

   This positional structure has been the biggest part that people have disliked
about JsonML, but yet in many XML documents (XHTML for example, being the
primary use case) position of the child nodes is critical to the meaning of the
document. So you get much smaller documents when you just add the element name
as the first child and make elements arrays.

   I'd encourage you to embrace JsonML and contribute to a standard that has been
around for four years already rather than creating a slightly different
approach.

   --- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
   >
   > For people interested in this topic.   We are always open to comments and
questions.
   >
   > https://www.p6r.com/articles/2010/04/05/xml-to-json-and-back/
   >
   >
   > Best,
   >
   > Mark Joseph, Ph.D.
   > President
   > P6R, Inc
   > 408-205-0361
   > mark@...
   > Skype: markjoseph_sc
   >
   >
   >
   > [Non-text portions of this message have been removed]
   >




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

#1509 From: "Mark Joseph" <mark@...>
Date: Tue Apr 6, 2010 6:35 pm
Subject: Re: SV: JSON representation for XML snippet
markjoseph_sc
Send Email Send Email
 
Ok I think I see how mixed content works in JsonML:

<description lang="en-us"> hi there <bold>joe</bold> how are you </descrption>

becomes

[ "description", {"lang":"en-us"},
        " hi there ",
         [ "bold", "joe" ],
         " how are you "
]

Is that right?


Best,

Mark Joseph, Ph.D.
President
P6R, Inc
408-205-0361
mark@...
Skype: markjoseph_sc
   _____

From: stephen.mckamey [mailto:stephen@...]
To: json@yahoogroups.com
Sent: Tue, 06 Apr 2010 10:20:12 -0700
Subject: Re: SV: [json] JSON representation for XML snippet






Not that ugly:

   ["node1", {"a":"45"},
        ["node2", {"b":"9", "c":"hithere"},
            ["node3", {"d":"abc"},
               ["node4", {"e":"12345"}, "JSON has no attributes"]
            ]
        ],
        "Now is the time for all good men to come to the aid of their party",

        ["node5", {"d":"45"}, "temperature is 70 degrees today"]
   ]

   --- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
   >
   >
   > Handling XML attributes when converting to JSON:
   > **************************************
   > <attribute a2="v2">value2</attribute>
   > will be
   > {"attribute":{"a2":"v2"},"#text":"value2"}
   >
   > as example ... while JSONML uses this kind of schema
   >
   > ["nodeName",{"a2":"v2"},"text or nested nodes"]
   >
   > so that this:
   >
   > <attributes>
   >    <attribute a2="v2">value2</attribute>
   > </attributes>
   >
   > will be this
   >
   > ["attributes",{},["attribute",{"a2":"v2"},"value2"]]
   >  ****************************************
   >
   > So all of the above works well when you have simple XML.
   > But with something like:
   >
   > <node1 a="45">
   >     <node2 b="9" c="hithere">
   >         <node3 d="abc">
   >            <node4 e="12345">JSON has no attributes</node4>
   >         </node3>
   >     </node2>
   >     Now is the time for all good men to come to the aid of their party
   >
   >     <node5 d="45">temperature is 70 degrees today</node5>
   > </node1>
   >
   > The resulting JSON is going to be "ugly".   Many added arrays
   > are added to handle the attributes and nested nodes now appear in the
   > added arrays.   To me this adds a lot of extra complexity that I am
   > not sure I want.
   >
   >
   >
   > Best,
   > Mark Joseph, Ph.D.
   > P6R, Inc
   >




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

#1510 From: "stephen.mckamey" <stephen@...>
Date: Tue Apr 6, 2010 6:43 pm
Subject: Re: Where our JSON product is heading: XML to JSON and Back
stephen.mckamey
Send Email Send Email
 
The attributes object is optional (see the BNF at http://jsonml.org) so you can
drop it if empty to make more compact.

The example XML:

<description abc="http://example.com">
     <abc:title>hi there</abc:title>
</description>

would encode in JsonML as:

["description", {"abc":"http://example.com"},
     ["abc:title", "hi there"]
]

To encode mixed content, I think you mean like this:

<div class="section">
     <p class="description">This is how <b>inline elements</b> get marked up.</p>
</div>

would encode to the JsonML:

["div", {"class":"section"},
     ["p", {"class":"description"}, "This is how ", ["b", "inline elements"], "
get marked up."]
]

Optionally, you could even encode the document whitespace as well if this was
significant to the original XML.

["div", {"class":"section"},
     "\r\n\t",
     ["p", {"class":"description"}, "This is how ", ["b", "inline elements"], "
get marked up."],
     "\r\n"
]

--- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
>
> Cool stuff, can you show me an example of how JsonML handles XML mixed
content, that is not clear to me from the web site.
>
>
> And just so it is clear to me, the namespace example would be something like:
>
> <description abc="http://example.com"><abc:title>hi
there</abc:title></description>
>
> becomes
>
> [ "description", {"abc" : "http://example.com"},
>         [ "abc:title", {}, "hi there" ]
> ]
>
> So the JSON application has to find the meaning of "abc:title", if it cares,
like XML applications do by looking for the first enclosing element with
> a definition for "abc"?
>
>
>
> Thanks,
>
> Mark Joseph, Ph.D.
> President
> P6R, Inc
> 408-205-0361
> mark@...
> Skype: markjoseph_sc
>   _____
>
> From: stephen.mckamey [mailto:stephen@...]
> To: json@yahoogroups.com
> Sent: Tue, 06 Apr 2010 10:11:22 -0700
> Subject: [json] Re: Where our JSON product is heading: XML to JSON and Back
>
>
>
>
>
>
>
>
>   JsonML ( http://jsonml.org ) handles all of these issues and has been
embraced by quite a number of places. Many JSON encoders already include
support.
>
>   It handles namespaces the same way that XML 1.0 did: include the name as
"prefix:local-name" and the URI to prefix mapping
(xmlns:abc="http://example.com/abc") as the attribute of the node that declared
it.
>
>   An early implementation of JsonML took a similar approach to including a
child object, but ultimately after some design discussions with Douglas
Crockford, his suggestion was to make the actual element an array like the child
object and have the element name be the first item.
>
>   This positional structure has been the biggest part that people have
disliked about JsonML, but yet in many XML documents (XHTML for example, being
the primary use case) position of the child nodes is critical to the meaning of
the document. So you get much smaller documents when you just add the element
name as the first child and make elements arrays.
>
>   I'd encourage you to embrace JsonML and contribute to a standard that has
been around for four years already rather than creating a slightly different
approach.
>
>   --- In json@yahoogroups.com, "Mark Joseph" <mark@> wrote:
>   >
>   > For people interested in this topic.   We are always open to comments and
questions.
>   >
>   > https://www.p6r.com/articles/2010/04/05/xml-to-json-and-back/
>   >
>   >
>   > Best,
>   >
>   > Mark Joseph, Ph.D.
>   > President
>   > P6R, Inc
>   > 408-205-0361
>   > mark@
>   > Skype: markjoseph_sc
>   >
>   >
>   >
>   > [Non-text portions of this message have been removed]
>   >
>
>
>
>
> [Non-text portions of this message have been removed]
>

#1511 From: "stephen.mckamey" <stephen@...>
Date: Tue Apr 6, 2010 6:45 pm
Subject: Re: SV: JSON representation for XML snippet
stephen.mckamey
Send Email Send Email
 
Exactly. We were posting very similar examples at the same time. :)

--- In json@yahoogroups.com, "Mark Joseph" <mark@...> wrote:
>
> Ok I think I see how mixed content works in JsonML:
>
> <description lang="en-us"> hi there <bold>joe</bold> how are you </descrption>
>
> becomes
>
> [ "description", {"lang":"en-us"},
>        " hi there ",
>         [ "bold", "joe" ],
>         " how are you "
> ]
>
> Is that right?
>
>
> Best,
>
> Mark Joseph, Ph.D.
> President
> P6R, Inc
> 408-205-0361
> mark@...
> Skype: markjoseph_sc
>   _____
>
> From: stephen.mckamey [mailto:stephen@...]
> To: json@yahoogroups.com
> Sent: Tue, 06 Apr 2010 10:20:12 -0700
> Subject: Re: SV: [json] JSON representation for XML snippet
>
>
>
>
>
>
> Not that ugly:
>
>   ["node1", {"a":"45"},
>        ["node2", {"b":"9", "c":"hithere"},
>            ["node3", {"d":"abc"},
>               ["node4", {"e":"12345"}, "JSON has no attributes"]
>            ]
>        ],
>        "Now is the time for all good men to come to the aid of their party",
>
>        ["node5", {"d":"45"}, "temperature is 70 degrees today"]
>   ]
>
>   --- In json@yahoogroups.com, "Mark Joseph" <mark@> wrote:
>   >
>   >
>   > Handling XML attributes when converting to JSON:
>   > **************************************
>   > <attribute a2="v2">value2</attribute>
>   > will be
>   > {"attribute":{"a2":"v2"},"#text":"value2"}
>   >
>   > as example ... while JSONML uses this kind of schema
>   >
>   > ["nodeName",{"a2":"v2"},"text or nested nodes"]
>   >
>   > so that this:
>   >
>   > <attributes>
>   >    <attribute a2="v2">value2</attribute>
>   > </attributes>
>   >
>   > will be this
>   >
>   > ["attributes",{},["attribute",{"a2":"v2"},"value2"]]
>   >  ****************************************
>   >
>   > So all of the above works well when you have simple XML.
>   > But with something like:
>   >
>   > <node1 a="45">
>   >     <node2 b="9" c="hithere">
>   >         <node3 d="abc">
>   >            <node4 e="12345">JSON has no attributes</node4>
>   >         </node3>
>   >     </node2>
>   >     Now is the time for all good men to come to the aid of their party
>   >
>   >     <node5 d="45">temperature is 70 degrees today</node5>
>   > </node1>
>   >
>   > The resulting JSON is going to be "ugly".   Many added arrays
>   > are added to handle the attributes and nested nodes now appear in the
>   > added arrays.   To me this adds a lot of extra complexity that I am
>   > not sure I want.
>   >
>   >
>   >
>   > Best,
>   > Mark Joseph, Ph.D.
>   > P6R, Inc
>   >
>
>
>
>
> [Non-text portions of this message have been removed]
>

#1512 From: "Fredag_d13" <jonas@...>
Date: Wed Apr 7, 2010 8:25 am
Subject: Re: SV: JSON representation for XML snippet
Fredag_d13
Send Email Send Email
 
That looks pretty perfect to me. I think I will include JSONML support in the
next release of my JSON api.

Thanks to Mark Joseph for starting this discussion and thank you Stephen for the
JSONML pointer.

I like the idea that no special characters such as @, # or stringpatterns are
needed.

/Jonas

--- In json@yahoogroups.com, "stephen.mckamey" <stephen@...> wrote:
>
> Exactly. We were posting very similar examples at the same time. :)
>
> --- In json@yahoogroups.com, "Mark Joseph" <mark@> wrote:
> >
> > Ok I think I see how mixed content works in JsonML:
> >
> > <description lang="en-us"> hi there <bold>joe</bold> how are you
</descrption>
> >
> > becomes
> >
> > [ "description", {"lang":"en-us"},
> >        " hi there ",
> >         [ "bold", "joe" ],
> >         " how are you "
> > ]
> >
> > Is that right?
> >
> >
> > Best,
> >
> > Mark Joseph, Ph.D.
> > President
> > P6R, Inc
> > 408-205-0361
> > mark@
> > Skype: markjoseph_sc
> >   _____
> >
> > From: stephen.mckamey [mailto:stephen@]
> > To: json@yahoogroups.com
> > Sent: Tue, 06 Apr 2010 10:20:12 -0700
> > Subject: Re: SV: [json] JSON representation for XML snippet
> >
> >
> >
> >
> >
> >
> > Not that ugly:
> >
> >   ["node1", {"a":"45"},
> >        ["node2", {"b":"9", "c":"hithere"},
> >            ["node3", {"d":"abc"},
> >               ["node4", {"e":"12345"}, "JSON has no attributes"]
> >            ]
> >        ],
> >        "Now is the time for all good men to come to the aid of their party",
> >
> >        ["node5", {"d":"45"}, "temperature is 70 degrees today"]
> >   ]
> >
> >   --- In json@yahoogroups.com, "Mark Joseph" <mark@> wrote:
> >   >
> >   >
> >   > Handling XML attributes when converting to JSON:
> >   > **************************************
> >   > <attribute a2="v2">value2</attribute>
> >   > will be
> >   > {"attribute":{"a2":"v2"},"#text":"value2"}
> >   >
> >   > as example ... while JSONML uses this kind of schema
> >   >
> >   > ["nodeName",{"a2":"v2"},"text or nested nodes"]
> >   >
> >   > so that this:
> >   >
> >   > <attributes>
> >   >    <attribute a2="v2">value2</attribute>
> >   > </attributes>
> >   >
> >   > will be this
> >   >
> >   > ["attributes",{},["attribute",{"a2":"v2"},"value2"]]
> >   >  ****************************************
> >   >
> >   > So all of the above works well when you have simple XML.
> >   > But with something like:
> >   >
> >   > <node1 a="45">
> >   >     <node2 b="9" c="hithere">
> >   >         <node3 d="abc">
> >   >            <node4 e="12345">JSON has no attributes</node4>
> >   >         </node3>
> >   >     </node2>
> >   >     Now is the time for all good men to come to the aid of their party
> >   >
> >   >     <node5 d="45">temperature is 70 degrees today</node5>
> >   > </node1>
> >   >
> >   > The resulting JSON is going to be "ugly".   Many added arrays
> >   > are added to handle the attributes and nested nodes now appear in the
> >   > added arrays.   To me this adds a lot of extra complexity that I am
> >   > not sure I want.
> >   >
> >   >
> >   >
> >   > Best,
> >   > Mark Joseph, Ph.D.
> >   > P6R, Inc
> >   >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>

#1513 From: "Mark Joseph" <mark@...>
Date: Wed Apr 7, 2010 11:11 am
Subject: Re: SV: JSON representation for XML snippet
markjoseph_sc
Send Email Send Email
 
We have also decided to support JsonML in
our next product version


Sent from my iPhone

On Apr 7, 2010, at 1:29 AM, "Fredag_d13" <jonas@...> wrote:

> That looks pretty perfect to me. I think I will include JSONML
> support in the next release of my JSON api.
>
> Thanks to Mark Joseph for starting this discussion and thank you
> Stephen for the JSONML pointer.
>
> I like the idea that no special characters such as @, # or
> stringpatterns are needed.
>
> /Jonas
>
> --- In json@yahoogroups.com, "stephen.mckamey" <stephen@...> wrote:
> >
> > Exactly. We were posting very similar examples at the same time. :)
> >
> > --- In json@yahoogroups.com, "Mark Joseph" <mark@> wrote:
> > >
> > > Ok I think I see how mixed content works in JsonML:
> > >
> > > <description lang="en-us"> hi there <bold>joe</bold> how are you
> </descrption>
> > >
> > > becomes
> > >
> > > [ "description", {"lang":"en-us"},
> > > " hi there ",
> > > [ "bold", "joe" ],
> > > " how are you "
> > > ]
> > >
> > > Is that right?
> > >
> > >
> > > Best,
> > >
> > > Mark Joseph, Ph.D.
> > > President
> > > P6R, Inc
> > > 408-205-0361
> > > mark@
> > > Skype: markjoseph_sc
> > > _____
> > >
> > > From: stephen.mckamey [mailto:stephen@]
> > > To: json@yahoogroups.com
> > > Sent: Tue, 06 Apr 2010 10:20:12 -0700
> > > Subject: Re: SV: [json] JSON representation for XML snippet
> > >
> > >
> > >
> > >
> > >
> > >
> > > Not that ugly:
> > >
> > > ["node1", {"a":"45"},
> > > ["node2", {"b":"9", "c":"hithere"},
> > > ["node3", {"d":"abc"},
> > > ["node4", {"e":"12345"}, "JSON has no attributes"]
> > > ]
> > > ],
> > > "Now is the time for all good men to come to the aid of their
> party",
> > >
> > > ["node5", {"d":"45"}, "temperature is 70 degrees today"]
> > > ]
> > >
> > > --- In json@yahoogroups.com, "Mark Joseph" <mark@> wrote:
> > > >
> > > >
> > > > Handling XML attributes when converting to JSON:
> > > > **************************************
> > > > <attribute a2="v2">value2</attribute>
> > > > will be
> > > > {"attribute":{"a2":"v2"},"#text":"value2"}
> > > >
> > > > as example ... while JSONML uses this kind of schema
> > > >
> > > > ["nodeName",{"a2":"v2"},"text or nested nodes"]
> > > >
> > > > so that this:
> > > >
> > > > <attributes>
> > > > <attribute a2="v2">value2</attribute>
> > > > </attributes>
> > > >
> > > > will be this
> > > >
> > > > ["attributes",{},["attribute",{"a2":"v2"},"value2"]]
> > > > ****************************************
> > > >
> > > > So all of the above works well when you have simple XML.
> > > > But with something like:
> > > >
> > > > <node1 a="45">
> > > > <node2 b="9" c="hithere">
> > > > <node3 d="abc">
> > > > <node4 e="12345">JSON has no attributes</node4>
> > > > </node3>
> > > > </node2>
> > > > Now is the time for all good men to come to the aid of their
> party
> > > >
> > > > <node5 d="45">temperature is 70 degrees today</node5>
> > > > </node1>
> > > >
> > > > The resulting JSON is going to be "ugly". Many added arrays
> > > > are added to handle the attributes and nested nodes now appear
> in the
> > > > added arrays. To me this adds a lot of extra complexity that I
> am
> > > > not sure I want.
> > > >
> > > >
> > > >
> > > > Best,
> > > > Mark Joseph, Ph.D.
> > > > P6R, Inc
> > > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>
>


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

#1514 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 13, 2010 12:52 pm
Subject: json-eo
douglascrock...
Send Email Send Email
 
Sonja Elen Kisa has provided a translation in Esperanto.

http://json.org/json-eo.html

#1515 From: Julien Verlaguet <julienverlaguet@...>
Date: Wed Apr 14, 2010 7:32 pm
Subject: Feedback needed
julienverlaguet
Send Email Send Email
 
Hi all,
I wrote a json to json transformation tool. It's a command line tool that uses
pattern-matching to write transformations.
Example:

jsonpat -p '{?"field1":x,y} -> {"new_field1":x,y}'

Renames the field1 into "new_field1".
There are quite a few constructions to extract and/or manipulate json data.
The tool can be found here: 

github.com/pika/jsonpat

It's still under active development, I would like to have some feedback.

Thanks for your time,

Julien




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

#1516 From: John Cowan <cowan@...>
Date: Wed Apr 14, 2010 8:05 pm
Subject: Re: Feedback needed
johnwcowan
Send Email Send Email
 
Julien Verlaguet scripsit:

> There are quite a few constructions to extract and/or manipulate
> json data.

You really need to write them down on your wiki page, even if just
briefly.  (I assume your current wiki page shows just a few of them.)
People can't be trying to decipher what the different possibilities are
from the OCaml source.

--
John Cowan   cowan@...    http://ccil.org/~cowan
The known is finite, the unknown infinite; intellectually we stand
on an islet in the midst of an illimitable ocean of inexplicability.
Our business in every generation is to reclaim a little more land,
to add something to the extent and the solidity of our possessions.
         --Thomas Henry Huxley

#1517 From: "julienverlaguet" <julienverlaguet@...>
Date: Wed Apr 14, 2010 8:32 pm
Subject: Re: Feedback needed
julienverlaguet
Send Email Send Email
 
> You really need to write them down on your wiki page, even if just
> briefly.  (I assume your current wiki page shows just a few of them.)
> People can't be trying to decipher what the different possibilities are
> from the OCaml source.

Good point, thanks. I tried to give all the ones which I use on an everyday
basis. I didn't put all of the ones I consider as "experimental" and subject to
changes or removal.
Another approach would be a BNF generated from the parser.

However, thanks for your comment.

Julien

#1518 From: John Cowan <cowan@...>
Date: Wed Apr 14, 2010 8:57 pm
Subject: Re: Re: Feedback needed
johnwcowan
Send Email Send Email
 
julienverlaguet scripsit:

> Another approach would be a BNF generated from the parser.

That would be very useful, with maybe a one-line comment for each.

--
De plichten van een docent zijn divers,         John Cowan
die van het gehoor ook.                         cowan@...
       --Edsger Dijkstra                         http://www.ccil.org/~cowan

#1520 From: "ninja" <ninja9578@...>
Date: Wed Apr 21, 2010 12:59 am
Subject: New JSON library
ninja9578
Send Email Send Email
 
Hi JSON group.

I wrote this library a few months ago, but I recently made it fully JSON
compatible. It's platform and language independent.

http://sourceforge.net/projects/libjson/

How do I add it to the list of json libraries on json.org? Let me know if you
find any bugs in it.

#1521 From: John Cowan <cowan@...>
Date: Wed Apr 21, 2010 5:56 pm
Subject: Re: New JSON library
johnwcowan
Send Email Send Email
 
ninja scripsit:
> Hi JSON group.
>
> I wrote this library a few months ago, but I recently made it fully JSON
compatible.  It's platform and language independent.

I haven't looked at the code (which is in C++, for the benefit of other list
readers),
but according to the documentation, full support for \u escapes is lacking.

>
> https://sourceforge.net/projects/libjson/
>
> How do I add it to the list of json libraries on json.org?  Let me know if you
find any bugs in it.
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

--
While staying with the Asonu, I met a man from      John Cowan
the Candensian plane, which is very much like       cowan@...
ours, only more of it consists of Toronto.          http://www.ccil.org/~cowan
         --Ursula K. Le Guin, Changing Planes

#1522 From: jonathan wallace <ninja9578@...>
Date: Wed Apr 21, 2010 6:49 pm
Subject: Re: New JSON library
ninja9578
Send Email Send Email
 
Oh, in order to get my library posted there, I've got to convert everything to
wide strings for the full range of \u utf32 characters?  Hmm, not sure if I'm
willing to do that since most users use std::string, and C has no wide string
support at all.  Oh well.




________________________________
From: John Cowan <cowan@...>
To: json@yahoogroups.com
Sent: Wed, April 21, 2010 1:56:27 PM
Subject: Re: [json] New JSON library


ninja scripsit:
> Hi JSON group.
>
> I wrote this library a few months ago, but I recently made it fully JSON
compatible.  It's platform and language independent.

I haven't looked at the code (which is in C++, for the benefit of other list
readers),
but according to the documentation, full support for \u escapes is lacking.

>
> https://sourceforge .net/projects/ libjson/
>
> How do I add it to the list of json libraries on json.org?  Let me know if you
find any bugs in it.
>
>
>
> ------------ --------- --------- ------
>
> Yahoo! Groups Links
>
>
>

--
While staying with the Asonu, I met a man from      John Cowan
the Candensian plane, which is very much like cowan@...
ours, only more of it consists of Toronto. http://www.ccil. org/~cowan
--Ursula K. Le Guin, Changing Planes






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

#1523 From: "Douglas Crockford" <douglas@...>
Date: Wed Apr 21, 2010 7:41 pm
Subject: Re: New JSON library
douglascrock...
Send Email Send Email
 
--- In json@yahoogroups.com, jonathan wallace <ninja9578@...> wrote:
> Oh, in order to get my library posted there, I've got to convert everything to
wide strings for the full range of \u utf32 characters?  Hmm, not sure if I'm
willing to do that since most users use std::string, and C has no wide string
support at all.  Oh well.


UTF-8 is another option.

#1524 From: jonathan wallace <ninja9578@...>
Date: Wed Apr 21, 2010 9:10 pm
Subject: Re: Re: New JSON library
ninja9578
Send Email Send Email
 
UTF8 doesn't support all of the characters supported by \uXXXX, four characters
mean UTF16. I do currently support UTF8, but that's only \u00XX.
  Anyway, since most users never use anything extended beyond UTF8, I am
currently working on making full support an build option, which will
automatically use wide characters and support full \u escaping.  Should finish
it up tomorrow.

:)





________________________________
From: Douglas Crockford <douglas@...>
To: json@yahoogroups.com
Sent: Wed, April 21, 2010 3:41:34 PM
Subject: [json] Re: New JSON library


--- In json@yahoogroups. com, jonathan wallace <ninja9578@. ..> wrote:
> Oh, in order to get my library posted there, I've got to convert everything to
wide strings for the full range of \u utf32 characters?  Hmm, not sure if I'm
willing to do that since most users use std::string, and C has no wide string
support at all.  Oh well.

UTF-8 is another option.







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

#1525 From: Chip Morningstar <chip@...>
Date: Wed Apr 21, 2010 9:17 pm
Subject: Re: Re: New JSON library
epopt
Send Email Send Email
 
That's just wrong.  See, e.g., http://en.wikipedia.org/wiki/UTF-8

Chip

jonathan wallace <ninja9578@...> wrote:

>UTF8 doesn't support all of the characters supported by \uXXXX, four characters
mean UTF16. I do currently support UTF8, but that's only \u00XX.

#1526 From: jonathan wallace <ninja9578@...>
Date: Thu Apr 22, 2010 2:32 pm
Subject: Re: Re: New JSON library
ninja9578
Send Email Send Email
 
libJSON 4.0 now fully supports \u escaped sequences if built using unicode. 
I've added project targets for the library, test suite, and embedded test suites
for these.  Unicode builds now use wstring and wchar_t strings to be able to fit
wide UTF8 characters, where regular builds still use string and chars as most
users use them.

I also made number parsing lazy for a slight speed boost. :)

http://sourceforge.net/projects/libjson/




________________________________
From: Chip Morningstar <chip@...>
To: json@yahoogroups.com
Sent: Wed, April 21, 2010 5:17:39 PM
Subject: Re: [json] Re: New JSON library


That's just wrong.  See, e.g., http://en.wikipedia.org/wiki/UTF-8

Chip

jonathan wallace <ninja9578@yahoo. com> wrote:

>UTF8 doesn't support all of the characters supported by \uXXXX, four characters
mean UTF16. I do currently support UTF8, but that's only \u00XX.






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

#1527 From: "Douglas Crockford" <douglas@...>
Date: Thu Apr 22, 2010 9:40 pm
Subject: Re: New JSON library
douglascrock...
Send Email Send Email
 
--- In json@yahoogroups.com, jonathan wallace <ninja9578@...> wrote:
>
> libJSON 4.0 now fully supports \u escaped sequences if built using unicode. 
I've added project targets for the library, test suite, and embedded test suites
for these.  Unicode builds now use wstring and wchar_t strings to be able to fit
wide UTF8 characters, where regular builds still use string and chars as most
users use them.
>
> I also made number parsing lazy for a slight speed boost. :)
>
> http://sourceforge.net/projects/libjson/


Does it do the right thing with "\uD834\uDD1E"? See
http://www.ietf.org/rfc/rfc4627.txt

#1528 From: "Fredag_d13" <jonas@...>
Date: Sun Apr 25, 2010 7:23 am
Subject: Railroad diagrams
Fredag_d13
Send Email Send Email
 
To Douglas Crockford

I'm writting some documentation to my JSON API and would like to add some
railroad diagrams. Can you tell me how you created the diagrams in "Javascript:
The good parts" and on json.org? I've tried to use a latex package named rails,
but the quality of the results does not match json.org.

Best regards Jonas

#1529 From: jonathan wallace <ninja9578@...>
Date: Fri Apr 23, 2010 2:15 am
Subject: Re: Re: New JSON library
ninja9578
Send Email Send Email
 
> Does it do the right thing with "\uD834\uDD1E" ? See http://www.ietf.
org/rfc/rfc4627. txt

I thought that wasn't officially part of JSON?  There is no mention of it on
json.org.  I was aware of that, but it left me confused, how would a parser know
the difference between a surrogate pair and simply two utf8 characters following
each other?

Obviously the E gives away that one, but U+64321 would be encoded as
\uD950\uDF21.





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

#1530 From: "Douglas Crockford" <douglas@...>
Date: Sun Apr 25, 2010 7:35 am
Subject: Re: Railroad diagrams
douglascrock...
Send Email Send Email
 
--- In json@yahoogroups.com, "Fredag_d13" <jonas@...> wrote:
> I'm writting some documentation to my JSON API and would like to add some
railroad diagrams. Can you tell me how you created the diagrams in "Javascript:
The good parts" and on json.org? I've tried to use a latex package named rails,
but the quality of the results does not match json.org.


I used Visio. The json.vsd file can be found in the Files section.
http://tech.groups.yahoo.com/group/json/files/

#1531 From: Andrea Giammarchi <andrea.giammarchi@...>
Date: Sun Apr 25, 2010 8:58 pm
Subject: PHP like __sleep, __wakeup, and Serializable interface
an_red...
Send Email Send Email
 
Any kind of thought/suggestion is welcome:

http://webreflection.blogspot.com/2010/04/json-sleep-wakeup-serialize-and.html

In few words, a way to better control serialization/de-serialization
processes using the JSON protocol we all know.
Small code, zero evaluation, namespace compatible (e.g.
serializer:"my.lib.namespace") and compatible with modules.

Regards


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

#1532 From: jonathan wallace <ninja9578@...>
Date: Wed May 5, 2010 5:40 pm
Subject: libJSON update
ninja9578
Send Email Send Email
 
libJSON now handles surrogate pairs correctly:
http://sourceforge.net/projects/libjson/
There is also now a makefile in the bundle for linux




________________________________
From: Douglas Crockford <douglas@...>
To: json@yahoogroups.com
Sent: Thu, April 22, 2010 5:40:32 PM
Subject: [json] Re: New JSON library



Does it do the right thing with "\uD834\uDD1E" ? See http://www.ietf.
org/rfc/rfc4627. txt




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

#1533 From: "Mark Joseph" <mark@...>
Date: Mon May 10, 2010 8:15 pm
Subject: XJR Offical Product Release
markjoseph_sc
Send Email Send Email
 
This is our first release of our combined JSON XML product SDK

Press Release:  https://www.p6r.com/company/news.html
Product Page:   https://www.p6r.com/software/xjr.html


Regards,

Mark Joseph, Ph.D.
President
P6R, Inc
408-205-0361
mark@...
Skype: markjoseph_sc



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

#1534 From: "Gary" <kaimaikid@...>
Date: Sat May 29, 2010 7:24 pm
Subject: Help needed please....
kaimaikid...
Send Email Send Email
 
Hi,
I'm new to the group as well as to using json and am wondering if someone can
write me a json script for .php webpage please?

What I need is to be able to get a json string (txt) from an url at say hourly
intervals

http://metservice.com/publicData/severeWeatherWarning

parse it and write it to a cache such as warning.txt keeping the html format in
the text.

and then have the webpage display the info from the warning.text without
hotlinking directly back to the source
when my page is opened each time, only going back to the url at the hourly
intervals to check for an update.

also for a separate webpage in php

A  script to fetch an image from a json string again at hourly intervals from

http://metservice.com/publicData/rainRadarLocL0Auckland

and

http://metservice.com/publicData/rainRadarLocL1Auckland

write both images to a folder on my site such as rainpic saving both images as
say rain0 and rain1
so that they overwrite the previous images and done so that it caches and not
hotlinking back to the original site

The displaying part is easy for me to sort here.

The reason for caching is to reduce bandwidth use on their site and not tying up
their resources as their load can
get heavy at times.

Many thanks in advance
Gary


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

#1535 From: jonathan wallace <ninja9578@...>
Date: Sat May 29, 2010 8:49 pm
Subject: Re: Help needed please....
ninja9578
Send Email Send Email
 
php has a built in function called json_decode.  You give it a string and it
returns you a stdClass, from there you can do whatever you want.




________________________________
From: Gary <kaimaikid@...>
To: json@yahoogroups.com
Sent: Sat, May 29, 2010 3:24:31 PM
Subject: [json] Help needed please....


Hi,
I'm new to the group as well as to using json and am wondering if someone can
write me a json script for .php webpage please?

What I need is to be able to get a json string (txt) from an url at say hourly
intervals

http://metservice.com/publicData/severeWeatherWarning

parse it and write it to a cache such as warning.txt keeping the html format in
the text.

and then have the webpage display the info from the warning.text without
hotlinking directly back to the source
when my page is opened each time, only going back to the url at the hourly
intervals to check for an update.

also for a separate webpage in php

A  script to fetch an image from a json string again at hourly intervals from

http://metservice.com/publicData/rainRadarLocL0Auckland

and

http://metservice.com/publicData/rainRadarLocL1Auckland

write both images to a folder on my site such as rainpic saving both images as
say rain0 and rain1
so that they overwrite the previous images and done so that it caches and not
hotlinking back to the original site

The displaying part is easy for me to sort here.

The reason for caching is to reduce bandwidth use on their site and not tying up
their resources as their load can
get heavy at times.

Many thanks in advance
Gary

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







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

Messages 1505 - 1535 of 1958   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help