Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Conversion from XML produces invalid JSON
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joni Freeman  
View profile  
 More options Aug 10 2012, 4:27 am
From: Joni Freeman <freeman.j...@gmail.com>
Date: Fri, 10 Aug 2012 01:27:28 -0700 (PDT)
Local: Fri, Aug 10 2012 4:27 am
Subject: Re: Conversion from XML produces invalid JSON

Hi,

Yes this indeed could be enhanced. I don't see why this couldn't convert
the above example to:

{ "f": ["1", "2", "3"], "z":"foo" }

I noticed that you already opened a ticket for this. I reopened it now
since this is a verified bug.

https://github.com/lift/framework/issues/1305

Cheers Joni

On Thursday, August 9, 2012 8:47:18 PM UTC+3, shveik wrote:

> When converting a flat array from xml, when combined with other elements,
> the resulting JSON is invalid. for example,
> when converting a piece of xml that looks like this:
> <f>1</f>
> <f>2</f>
> <f>3</f>
> , the result is correct : "f" : [1,2,3], however, if we add another node:

> <f>1</f>
> <f>2</f>
> <f>3</f>
> <z>foo</z>, the result is something like this: { "f": "1", "f": "2", "f":
> "3", "z":"foo" }. I believe this is happening because of the array_?
> definition is checking distinct = 1 for fields of surrounding element.
> a possible solution would be to first group by the name of the node and
> then do the array check for each group where an array is the map's value
> where count > 1. that would not drop elements and produce "correct" JSON.

> Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.