XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
(Deleted User) Subject: Another JSON problem
Author: (Deleted User)
Date: 10 Oct 2011 05:41 AM
I have another problem with JSON - it will be my ignorance of the format, I am sure.

The attached file is quite large (76,115 bytes), and I can handle it OK with .NET JSON serializer and regular expressions, but that is very messy (at least, my coding is).

When using the James Newton-King library JSON.NET, it fails to convert to XML at position 206 (it is a single line string, as I use the file).

The file has its original beginning [ and final ] characters removed.

SS reads in the same amount.

What must I do to handle the entire JSON file?

Ian Thomas
--------------
Stylus Studio 2011 XML Enterprise Suite R2 (Build 1756a)


Documentcatalog20110930_2129.json.txt
75K JSON file

Posttop
(Deleted User) Subject: Another JSON problem
Author: (Deleted User)
Date: 12 Oct 2011 09:16 AM
One solution was provided by @VoidMain at the CodePlex JSON.NET discussion.

It requires minor edit of the string, pre-pending '{objects:' and appending '}' to the JSON as written in my original post.

So, it becomes -

{objects:[{"a":"2958081","b":"Contact Sport","e":"abc4 news sport recent","f":[{"a":"831081","f":"2011-09-30 23:00:00","g":"2011-10-14 23:00:00"},{"a":"831080","f":"2011-09-23 23:00:00","g":"2011-10-07 23:00:00"}]},{"a":"2959838","b":"ABC National Evening News","e":"news abc4 recent last-chance","f":[{"a":"831928","f":"2011-09-30 23:00:00","g":"2011-10-01 22:00:00"}]}]}

Of course, 'objects' can be (almost) any other word representing the collection of objects.

Ian Thomas
--------------
Stylus Studio 2011 XML Enterprise Suite (Build 1756a)

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.