[Home] [By Thread] [By Date] [Recent Entries]
On 02/05/2025 13:07, Michael B Allen ioplex@xxxxxxxxx wrote: [...] For example, it is commonplace to do something like the following: I respectfully disagree. The canonical test is for values known or attested to be discrete (eg standard State or Country abbreviations) to be attribute values (preferably in a token list [enumerated] if possible); and values which are infinitely variable (eg street addresses) to be plain text content (PCDATA). But it's a sliding scale and no single answer is "correct": it leaves things like city/town names, which may or may not be discrete values for the locale; and possibly street names in the same position, with house number or name being a separate attribute. And many addresses have multiple intervening (sometimes hierarchical) values like locality, townland, district, county, etc. There is no end to the varieties of address markup, and almost every single one of them is "wrong" in some way. which means the truly correct way to represent this data is: Technically possible. Anyway, my point is that the only "correct" way to convert JSON to XML is to understand in advance which of the many XML representations is "correct" for your particular application and then write code to explicitly perform that conversion. Best way. Peter
|

Cart



