JSON module snelson parsing problem

Bug #930573 reported by William Candillon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Paul J. Lucas

Bug Description

The following query:

import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";
import module namespace file = "http://expath.org/ns/file";

let $tweet := file:read-text("tweet.json")
let $tweet := json:parse($tweet)
let $tweet := json:serialize($tweet)
return
  $tweet

Where tweet.json (in attachement) comes from the twitter stream API, returns:

JSON serialization error [zerr:ZJSE0005]: "pair": illegal child element of "array" type; must be "item"
=================================================
json:serialize#1 <http://www.zorba-xquery.com/modules/converters/json>
/parse.xq at line 6 column 15

Related branches

Revision history for this message
William Candillon (wcandillon) wrote :
Changed in zorba:
assignee: nobody → Paul J. Lucas (paul-lucas)
importance: Undecided → High
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

As I've tried to explain, this bug (and your previous few bugs) have nothing to do with serialization. The reason the serialization reports the problem is because the *parser* is producing incorrect XDM. The serializer then attempts to serialize the XDM and (correctly) reports the error.

summary: - JSON module serialization problem
+ JSON module snelson parsing problem
Changed in zorba:
status: New → In Progress
Changed in zorba:
status: In Progress → Fix Committed
Revision history for this message
William Candillon (wcandillon) wrote :

Please never mark a bug that I reported as fix committed. Always assign it back to me for closing.
As a good illustration of my point, the parse/serialize function is still completely broken.
I will make a more detailled report later.

Changed in zorba:
status: Fix Committed → In Progress
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

The query works with the tweet.json you attached.

Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.