Feature #4649
closed
Add a new JSON serialiser to change sibbling with same names in array
Added by Lequeux Olivier over 11 years ago.
Updated almost 11 years ago.
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.
- Subject changed from PHP serialized array renderer to Add a new JSON serialiser to change sibbling with same names in array
- 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?
- 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.
- Priority changed from Low to Normal
<e:entries> et <e:entry> should be removed from generated JSON
- Status changed from New to Resolved
- Assigned To set to Reynaud Sylvain
- Target version set to 2.0
- % Done changed from 0 to 100
Also available in: Atom
PDF