[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A generic approach to XML design versus a hardcodedapproac
And of course we always joke about this document type: <!ELEMENT element ANY > <!ATTLIST element tagname NAME #REQUIRED > <!ELEMENT attribute EMPTY > <!ATTLIST attribute name NAME #REQUIRED value CDATA #REQUIRED > If your XML CMS requires all documents to be grammar valid, then validate this. Cheers, Eliot -- Eliot Kimber http://contrext.com From: "Costello, Roger L." <costello@mitre.org> Date: Friday, October 7, 2016 at 8:20 PM To: "xml-dev@l..." <xml-dev@l...> Subject: A generic approach to XML design versus a hardcoded approach to XML design Hi Folks, Compare these two designs for modeling an event occurring on March 21, 2012:
<graduation date="2012-03-21"/>
<event type="graduation" date="2012-03-21"/> The second design uses a “generic approach to XML design.” The <event> element denotes any arbitrary (generic) event. The attribute value identifies the specific event.
The first design uses a “hardcoded approach to XML design.” The <graduation> element hardcodes the event. In the generic approach the semantics is in the attribute value. In the hardcoded approach the semantics is in the element name. The generic approach, when coupled with Schematron, enables the creation of powerful (flexible, extensible) data models. Other events can be readily created without any modification to an XML
Schema. For example: <event type="Autumnal Equinox" date="2017-09-22"/> Here’s another event (note the rich semantics): <event type="U.S. presidential election" date="2016-11-08"/> Regrettably, many people are not taking advantage of generic XML designs. Here’s what Rick Jelliffe says:
Mainstream XML technology definitely disfavors generic approaches: Comments? Thanks Rick for raising this important issue. /Roger
[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
|