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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1182)
- Stylus Studio Technical Forum (14569)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-> + Problem with SAXO processor - ... (5)
-> + PDF Format Help (4)
-> + License check unreliable (2)
-> - XML related issue (1)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7617)
+ XQuery Help and Discussion (1966)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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)

   
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.