Actions
Feature #4649
closedAdd a new JSON serialiser to change sibbling with same names in array
Start date:
06/12/2013
Due date:
% Done:
100%
Estimated time:
Description
Could be great to have '?accept=php_array' renderer to directly inject data from lavoisier in a 
php array.
We can imagine to provide php object toot (like stdclass): to be discussed.
      
      Updated by Lequeux Olivier over 12 years ago
      
    
    - Subject changed from PHP serialized array renderer to Add a new JSON serialiser to change sibbling with same names in array
 
      
      Updated by Reynaud Sylvain over 12 years ago
      
    
    - Status changed from New to Feedback
 - Assigned To set to Lequeux Olivier
 
Since renderers must be able to render any XML data, this choice would produce quite complex JSON outputs:
<ul>
<li style="color:red">First Item</li>
<li title="Some hover text." style="color:green">
Second Item
</li>
<li><span class="code-example-third">Third</span>
Item</li>
</ul>
{
    "ul":
    {
        "li":
        [
            [
                { "style" : "color:red" },
                "First Item" 
            ],
            [
                {
                    "title" : "Some hover text.",
                    "style" : "color:green" 
                },
                "Second Item" 
            ],
            [
                {
                    "span":
                    [
                        { "class" : "code-example-third" },
                        "Third" 
                    ]
                },
                " Item" 
            ]
        ]
    }
}
	Can you please confirm that such a complexity does not make this rendering useless?
      
      Updated by Reynaud Sylvain over 12 years ago
      
    
    - Status changed from Feedback to New
 - Assigned To deleted (
Lequeux Olivier) 
Modify the existing JSON renderer.
Add parameters:
- element-as-array=TRUE|false. If element-as-array, then sibling elements with same name are grouped into an array (<li>a</li><li>b</li> = "li":[]).
 
- text-as-pair=TRUE|false. If text-as-pair, then text nodes are converted to pairs "#text": "value".
 
- abort-on-conflict=true|FALSE. If abort-on-conflict, then conflicting names will raise an exception. Else conflicting names will be renamed to "name#1", "name#2"...
 
Text nodes are trimed, and empty text strings are ignored.
Namespaces will be ignored.
      
      Updated by Reynaud Sylvain about 12 years ago
      
    
    - Priority changed from Low to Normal
 
      
      Updated by Reynaud Sylvain about 12 years ago
      
    
    <e:entries> et <e:entry> should be removed from generated JSON
      
      Updated by Reynaud Sylvain almost 12 years ago
      
    
    - Status changed from New to Resolved
 - Assigned To set to Reynaud Sylvain
 - Target version set to 2.0
 - % Done changed from 0 to 100
 
Actions