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 (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + 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)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2016)
+ 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.