Re:New better alterative to XML, JSON and YAML
by GeneThomas on Sunday November 10, 2024 @10:22PM
(#42104364)
> * Native support for arrays. I mentioned a few above. `<<Faults$$>>` and `<<$$>>` -- guess what these two mean if you see this first time? You would never guess. It's an empty array and an empty element, you've just failed.
<< means it relates to starting an array, $>> means it is the end, $$ meaning something else — an empty array!
The xᴍʟ alternative is a bodge:
public class PurchaseOrder
{
public Item[] ItemsOrders;
}
public class Item
{
public string ItemID;
public decimal ItemPrice;
}
<< means it relates to starting an array, $>> means it is the end, $$ meaning something else — an empty array!
The xᴍʟ alternative is a bodge:
serializes to: Where the array is marked up as two sub elements both called <Item>:Xᴇɴᴏɴ has first class support for arrays:
The elements may be scalars so has an array with one item of the empty string. So a separate syntax for empty arrays is required!