XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Help with XML anti pattern

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS