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

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Which is more declarative? More XMLish?
• From: "Costello, Roger L." <costello@mitre.org>
• To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
• Date: Sat, 2 Dec 2017 14:26:36 +0000

 Hi Folks, XML documents oftentimes contain a set of things – a set of books, a set of people, a set of transactions, etc. Typically, a set isn’t allowed to contain just anything, the set must satisfy some constraints. Constraints can be expressed in different ways. Perhaps one way is better than another? Perhaps one is more declarative, the other more imperative? Perhaps one is XMLish, the other not? Example: Here is an XML document containing a set (of positive even numbers):     0     2     4     6     …   Here are two ways to specify the set:   1. Defining properties: identify the properties that each member of the set must have. In this example, each number must have these 2 properties:   Positivity Evenness   The two properties can be expressed in Schematron:                    Property: to be a member of the set, the number must be positive.                      Property: to be a member of the set, the number must be even.       2. Generate set members: specify how to generate the members of the set. The set of positive even numbers can be generated this way:   0 is an element of the set. If x is an element of the set, then x+2 is an element of the set. (Alternatively: if x is an element of the set, then x-2 is an element of the set) Nothing else belongs to the set.   Generating the set’s members can be expressed in Schematron:                    0 is in the set.                      If i is in the set, then i-2 is in the set           Recap: We’ve seen two ways to specify (constrain) a set: (a) State a property (or properties) that an object must have to qualify as a member of the set. (b) Define a set of rules which generate its members.   Which way is better? Which is preferred? Which is more declarative? Which is more XMLish?   /Roger

[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