Subject: Re: [xsl] Convert JSON to XML? From: "Michael B Allen ioplex@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 2 May 2025 18:24:09 -0000 |
On Fri, May 2, 2025 at 11:18b/AM Tony Graham tgraham@xxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > On 02/05/2025 14:37, Peter Flynn peter@xxxxxxxxxxx wrote: > > On 02/05/2025 13:07, Michael B Allen ioplex@xxxxxxxxx wrote: > > [...] > >> For example, it is commonplace to do something like the following: > >> > >> <address> > >> \xA0\xA0 <street>123 Main St</street> > >> \xA0\xA0 <city>Townville</city> > >> \xA0\xA0 <state>PA</state> > >> </address> > >> > >> IMO the "correct" form for an XML element is to put values that > >> are not divisible into attributes > > > > 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": > > Another "correct" form is to avoid using attribute values for user > readable content because that can make translation somewhere between > difficult and impossible: > I agree with both of you IF the address values are conventional text that might be translated or, more likely, rendered in a typesetting context such as for manufacturing street signs for example. However, it is much more likely that the street value like "123 Main St" is not conventional text but data and more specifically identifiers that are not divisible which therefore, by my rule, should be attributes. Annoying semantics I know. But in the long term it's probably worth being a little pedantic. Mike -- Michael B Allen Java AD DS Integration https://www.ioplex.com/ <http://www.ioplex.com/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Convert JSON to XML?, Tony Graham tgraham@ | Thread | Re: [xsl] Convert JSON to XML?, Liam R. E. Quin liam |
Re: [xsl] Convert JSON to XML?, Liam R. E. Quin liam | Date | [xsl] Creating strings with apos an, dvint@xxxxxxxxx |
Month |