[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: 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@l...>
  • Date: Tue, 23 Nov 2021 17:50:14 -0500

Re:  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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.