News for hackers. Stuff that matters.
Re:Xee: A Modern XPath and XSLT Engine in Rust by ssdspoimdsjvv on Saturday March 29, 2025 @07:04AM (#43514483)
<p>How would you represent <b><i>mixed content</i></b> in JSON?</p>
Re:Xee: A Modern XPath and XSLT Engine in Rust by winstonewert on Saturday March 29, 2025 @09:25AM (#43515359)
`{ type: "p", children: [{type: "text", text: "How would you represent "}, {type: "b", children: [{type: "i", children: [{type: "text", text: "mixed content"}]], {type: "text", text: " in JSON?"]}`

or:

`{paragraphs: [{spans: [{ text: "How you represent "}, {bold: true, italic: true, text: "mixed content"},{text: " in JSON?"}]}`

Re:Xee: A Modern XPath and XSLT Engine in Rust by ssdspoimdsjvv on Saturday March 29, 2025 @12:01PM (#43516507)
Oh sure, it can be represented. But now JSON is the one being noisy, ugly and verbose.
Re:Xee: A Modern XPath and XSLT Engine in Rust by winstonewert on Saturday March 29, 2025 @06:22PM (#43519245)
My specific claim was that you could represent it in JSON, so you can't claim, as the post I responded to did, that JSON "cannot be used."

I'll fully grant, I don't want to write a document by hand in either of the JSON formats I suggested. Although, given the choice, I'd rather receive it in that format to be parsed than in any XML format.

Re:Xee: A Modern XPath and XSLT Engine in Rust by Finnucane on Saturday March 29, 2025 @11:27AM (#43516280)
But that's terrible! How is that better? And can you guarantee correct ordering?
Re:Xee: A Modern XPath and XSLT Engine in Rust by lioeters on Saturday March 29, 2025 @11:56AM (#43516471)

  ["p", "How would you represent ", ["b", ["i", "mixed content"]], " in JSON?"]