[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|