OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] A generic approach to XML design versus a hardcodedapproach to XML design

Yes, I actually have had to use something like this.  It was pre-XML, when a document *had* to have a DTD  but I needed to get arbitrary information from A to B without being able to actively maintain the intermediate format.  Felt shame, cold, fear.   Now in XML we just omit the DOCTYPE:  X!

It would have been
<!ELEMENT element (atribute*, element*) >


On Sat, Oct 8, 2016 at 3:59 PM, Eliot Kimber <ekimber@contrext.com> wrote:
And of course we always joke about this document type:

<!ELEMENT element ANY >
<!ATTLIST element tagname NAME #REQUIRED >

<!ELEMENT attribute EMPTY >
<!ATTLIST attribute

If your XML CMS requires all documents to be grammar valid, then validate this.


Eliot Kimber

From: "Costello, Roger L." <costello@mitre.org>
Date: Friday, October 7, 2016 at 8:20 PM
To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
Subject: [xml-dev] 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:
               to move to generic approaches where the specific semantics is in
               attributes *and* retaining validation requires moving to RELAX NG
               or Schematron in which attributes are first-class citizens (rather than
               DTDs or XSD where all patterns/types are keyed by element context


Thanks Rick for raising this important issue.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS