Re: [xsl] Convert JSON to XML?

Subject: Re: [xsl] Convert JSON to XML?
From: "Peter Flynn peter@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 May 2025 14:24:09 -0000
On Fri, 2025-05-02 at 12:07 +0000, Michael B Allen ioplex@xxxxxxxxx wrote:

<address \xA0 street="123 Main St" \xA0 city="Townville" \xA0 state="PA"/>

On 02/05/2025 18:33, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx wrote:


A good rule of thumb for document-oriented information in XML is
that anything user-facing should be in text content, and attributes
are for "properties" of that information.

<rant>


By that rule, it should be

<address
number="123"
street="Main Street"
city="Townville"
state="PA"/>

:-)

IMNSHO never use abbreviations like St, Rd, Ave, etc because of the risk of misinterpretation in international contexts, eg

St Margaret's St
Rd Randall Rd

The general rule is that an address can just be an unmarked string.

You MAY try to enfield it for your own convenience, but you have to be prepared to fail: most of the world does NOT have "street/city/zip" format. Those of you over a certain age :-) may recognise the "townland/locality/postal town/county" rural format common in the UK and Ireland pre-postcode, (and possibly the USA pre-zip) eg

Ceann Mha\xED, Barley Cove, Goleen, County Cork

If the current ultra-smart, AI-backed, geolocational, field-based form cannot handle addresses outside the "street/city/zip" format, then it's basically useless.

</rant>

On 14/05/2025 11:49, Tony Graham tgraham@xxxxxxxxxxxxx wrote:
Let's suppose you have a town on the border between Germany and Poland, and you need to give both names for it in the address, marking each with its language using xml:lang. You cannot do that with attributes.

I think TEI provides for multiple parallel addresses for this reason.


I once lived at '103 White Village, 2-20-6 Kasugachou' and 'C#BBC#BB/C#BB$C#BBC#BB
C#BB,C#BBC#BB8103 C&BB%C&BB%C'BB:2-20-6' (and 'C&BB%C&BB%C'BB:2-20-6-103'), IIRC.

[...] Working
from marked-up parts of textual content would have been so much easier
than reconstituting international addresses from database fields.

Amen


Peter

Current Thread