[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! 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
|