Skip to search.
json · JSON JavaScript Object Notation

Group Information

  • Members: 531
  • 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

  Messages Help
Advanced
mixed content and attributes   Message List  
Reply Message #345 of 1841 |
Re: mixed content and attributes

> About the first, it related about a XML document like this:
>
> <book>
> <chapter>Content of the first chapter</chapter>
> <chapter>Content of the first [sic] chapter
> <chapter>Content of the first subchapter</chapter>
> <chapter>Content of the second subchapter</chapter>
> </chapter>
> <chapter>Third Chapter</chapter>
> </book>

There are many ways that you could render that into JSON. This is how
org.json.XML does it in Java:

{"book": {"chapter": [
"Content of the first chapter",
{
"content": "Content of the first [sic] chapter",
"chapter": [
"Content of the first subchapter",
"Content of the second subchapter"
]
},
"Third Chapter"
]}}






Tue May 23, 2006 2:50 pm

douglascrock...
Offline Offline
Send Email Send Email

Message #345 of 1841 |
Expand Messages Author Sort by Date

Hi all, i'm new in the JSON world and I'm searching in it a good alternative to XML. To begin, I translated some XML data in JSON format, and I crashed soon...
Marco Rosella
marcorosella Offline Send Email
May 23, 2006
2:39 pm

... There are many ways that you could render that into JSON. This is how org.json.XML does it in Java: {"book": {"chapter": [ "Content of the first chapter", ...
Douglas Crockford
douglascrock... Offline Send Email
May 23, 2006
2:50 pm

Can we use function definitions in JSON? Eg. {"book": { "name": "bookname", "chapter": [...], "gotoChapter" : function(chapterId) {...} } } And how about using...
Mert Sakarya
mertsakarya Offline Send Email
May 23, 2006
3:29 pm

... Please, no! That violates just about everything JSON is about. If you want to pass functions around, just use JavaScript in the first place, and forget ...
Martin Cooper
mfncooper Offline Send Email
May 23, 2006
4:11 pm

You know Mert -- I think you are on to something here but I have to suggest an alternative to your implementation -- I personally can't readily accept a...
Greg Patnude
gregpatnude Offline Send Email
May 23, 2006
4:22 pm

I think why JSON be successful as a data-interchange format is its simplicity and neutral nature for many languages. Adding function definition just make JSON ...
Fang Yidong
fangyidong Offline Send Email
May 24, 2006
1:45 am

... Agreed. Maybe define a std date format, there's a ISO one which would do fine. -- Lindsay...
Lindsay
softlog_lindsay Offline Send Email
May 25, 2006
11:35 pm

I have a JSON compatible date parser which converts a stringified version of a C-Type date (mm-dd-yyyy hh:mm:ss.nnnn [AM:PM]) into a JavaScript native Date...
Greg Patnude
gregpatnude Offline Send Email
May 26, 2006
3:25 pm

... Why the C format? Why not base it on the ISO standard, if we have to include dates in JSON? And if the above format actually defines what you have, then ...
Martin Cooper
mfncooper Offline Send Email
May 26, 2006
4:33 pm

... Maybe I'm missing something, but why wouldn't one simply use the standard unix time? It does not rely on time-zones (which people seem to largely ignore on...
Christopher Stumm
christopher.... Offline Send Email
May 26, 2006
4:43 pm

It is originally based on converting a date-time string from an ANSI SQL database into a JavaScript UTC time... The ANSI SQL datetime (timestamp) appeared to...
Greg Patnude
gregpatnude Offline Send Email
May 26, 2006
9:06 pm

It's not necessary to add Date SPEC to JSON to make things work. JSON just give you the freedom to do whatever you want. I've used JSON.simple to exchange...
Fang Yidong
fangyidong Offline Send Email
May 27, 2006
4:20 am

... Except for time zones. ... As another poster commented, unix epoch is a great transmission format thanks to its explicit treatment of time zones. Every...
Michal Migurski
michal_migurski Offline Send Email
Jun 3, 2006
7:07 pm

... I completely agree. We were unable to use the GNOTE-licensed code in either our GPL application, or in our other app that's currently closed-source....
Kevin Smith
kevinbsmith Offline Send Email
Jun 3, 2006
4:37 pm

... <snip/> ... No, that's not the case (and there is no "arguably" ;), at least from an ASF perspective. There is a policy in place at the Apache Software...
Martin Cooper
mfncooper Offline Send Email
Jun 7, 2006
5:01 am

I think everyone is missing teh point I am trying to make --- I truly believe that "Object Notation" is the holy grail of data interchange. As a result, I...
Greg Patnude
gregpatnude Offline Send Email
May 26, 2006
3:38 pm

Greg, I've given this a bit of thought too, but in the end this would only complicate matters exponentially. Making a simple data parser is one thing, but...
Dave Balmer
dbalmerjr Offline Send Email
May 26, 2006
7:10 pm

... Agreed. I'd like to see a std for dates as they are very commonly used and nearly count as a scalar type :) But stick to the KISS principle. Feature bloat...
Lindsay
softlog_lindsay Offline Send Email
May 28, 2006
11:00 pm
Advanced

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