[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Help with XML anti pattern
- From: "Liam R. E. Quin" <liam@fromoldbooks.org>
- To: William David Velasquez <wd@creativosdigitales.co>, XML Developers List <xml-dev@lists.xml.org>
- Date: Tue, 23 Nov 2021 17:50:14 -0500
On Tue, 2021-11-23 at 13:21 -0500, William David Velasquez wrote:
>
> I'm asking for your help, because we'll have a meeting with the
> contractor and I need arguments to convince them of changing to a
> "Natural" XML structure like this:
>
> > <SWMaker>
> > <SWMakerInfo>
> > <FirstName>Erick</FirstName>
> > <LastName>Rich</LastName>
> > <SWName>FancySoft v.1.0</SWName>
> > </SWMakerInfo>
> > </SWMaker>
The first question is whether there will ever be field names that are
not legal XML element names. In that case, Name/Value work better.
If you stick with Name/Value, i second Michael Kay's suggestion of a
wrapper element for each pair. That would also allow multiple values,
e.g. for different languages:
<Pair>
<Name>MonthOfBirth</Name>
<Value xml:lang="en">January</Value>
<Value xml:lang="pt">Janeiro</Value>
</Pair>
potentially with <Label> elements if needed, for a human-readable
version of the field name in each language.
As for attributes, ask if you'll ever need markup -- including e.g.
ruby for Chinese or Japanese -- inside a value; if so, you need the
text in element content.
Liam
--
Liam Quin, Paligo AB
https://www.delightfulcomputing.com/
http://www.fromoldbooks.org
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]