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

Re: Advantages/disadvantages of extremely simple XMLdesigns

  • From: "Liam R. E. Quin" <liam@fromoldbooks.org>
  • To: "Costello, Roger L." <costello@mitre.org>, "xml-dev@l..." <xml-dev@l...>
  • Date: Sat, 11 Aug 2018 23:20:06 -0400

Re:  Advantages/disadvantages of extremely simple XMLdesigns
On Sat, 2018-08-11 at 14:35 +0000, Costello, Roger L. wrote:
> [...]
> <properties>
>     <entry key="A">A content</entry>
>     <entry key="B">B content</entry>

This was for years a common XML (and SGML) half-anti-pattern. If you
know the majority of the key values and they're safe, use element
names,
<properties>
  <sock-colour>blue</sock-colour>

That way you can validate them, authoring software can help suggest
them, and it's no harder to deal with in an application. There can
still be "entry" elements for new/unknown values.

But if the values aren't known in advance then yes, you want xsd 1.1
and/or schematron.

You could use _only_ Schematron, but if you want type assignment - e.g.
it's going into a database to be queried with XPath 2 or later or with
XQuery then XSD is an obvious win.

Schematron is quite widely supported, by the way, including as
assertions inside an XML Schema. Support for XSD 1.1 is more limited
but still not that uncommon in some environments.

What's most important is that the design fits with how the people who
work with the information think about it. You could use XSLT to
transform it into something you can validate, for example, probably
fairly efficiently.

Liam


-- 
Liam Quin, https://www.holoweb.net/liam/cv/
Web slave for vintage clipart http://www.fromoldbooks.org/
Available for XML/Document/Information Architecture/
XSL/XQuery/Web/Text Processing/A11Y work & consulting.



[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.