[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] RE: Declarative programming requires a different mindset
- From: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Sun, 11 Apr 2010 17:52:54 -0400
At 2010-04-11 16:29 -0400, Costello, Roger L. wrote:
>If XSD is not a programming language then what is it?
>
>People have said that XSD is:
> - a declarative language
> - descriptive markup
>
>I think that a programming language is a syntax for solving problems
>(where the syntax is such that it can be processed by a computer).
Fine ... provided you use the plural "problems" ... I think a
programming language is a syntax of semantic actions that can be
arranged and rearranged by the writer to produce different actions on
the same or different inputs, thus solving different kinds of problems.
>XSD is a syntax for solving certain problems. Specifically, XSD is
>for solving constraint problems, i.e.,
>
> Is the input ____ constrained in this ____ way?
I disagree. That sounds too imperative to me. Wouldn't "does the
input violate any of these constraints?" be a better way of saying
it? I don't think that is simply the opposite. How about "does the
input satisfy these constraints?"?
All schema languages are declarations of constraints. *How* a
constraint checker checks the constraints is irrelevant to the fact
that only one process is happening: constraint-checking. An XML
document describing constraints isn't much different than an XML
document describing a spreadsheet, or a book index, or anything other
collection of information.
The semantics of the constraints are different with different languages:
DTD - a pattern grammar
Regular Language for XML (RELAX-NG) - a pattern grammar
W3C Schema - a type hierarchy
ISO Schematron - a set of assertions
NVDL - one ring to bind them
>A computer can evaluate an input document against an XSD document
>and produce an answer to the question, i.e., using the XSD language
>the problem can be solved.
Again, I wouldn't word it that way. The XSD language describes the
constraints and a constraint checker checks to see if any constraints
are violated. It isn't changing the problem being solved. It is
just changing the inputs to the one unchanging problem being solved.
>I understand that the set of problems that can be solved using XSD
>are very specific.
"set of problems"? I disagree. I see only one: describe the
constraints on elements, attributes and text in markup. An XSD
front-end is a process interpreting what those constraints are when
massaging elements, text and attributes for application processing,
but that doesn't make the XSD a programming language.
A W3C Schema expression doesn't describe a process. It describes the
end result of what a fixed and well-defined process described by the
specification produces when acting on it. If I want to change an
application's view of <item>123456</item> from "123456" to the number
123,456 then I change the inputs to change the type of constraint on
the element. But I haven't changed the problem.
The W3C Schema processor runs a process with the expression as
input. That process doesn't change based on the input, but what is
checked does change based on the input.
>People have said that a programming language is one that can solve
>many different kinds of problems. Certainly, then, XSD is not a
>programming language.
>
>Both XSD and programming languages are languages for solving problems.
I suppose. XSD solves *one* problem and a programming language can
be used to solve many and varied problems.
>So, if I were to draw a Venn diagram I would draw a:
>
> - bubble for XSD
> - bubble for programming languages (independent of the XSD bubble)
> - put both of the bubbles inside a big bubble
>
>What would you label the big bubble?
>
>Here's a graphic to illustrate my question:
>
>http://www.xfront.com/XML-Declarative-Programming/XSD-and-programming-languages-are-a-type-of-what.gif
>
"The infinite set of XML instances"? I think anything you come up
with would be a tautology of "all things" based on the limited
description of what you want.
Turn it around and I might have a better idea of what you are trying
to look for ... what would you, Roger, use as an example of something
*outside* of the big bubble?
Why have the big bubble? What is missing in your work with XML that
needs such a bubble to be defined?
I hope this helps.
. . . . . . . . . . . Ken
--
XSLT/XQuery training: San Carlos, California 2010-04-26/30
Principles of XSLT for XQuery Writers: San Francisco,CA 2010-05-03
XSLT/XQuery training: Ottawa, Canada 2010-05-10/14
XSLT/XQuery/UBL/Code List training: Trondheim,Norway 2010-06-02/11
Vote for your XML training: http://www.CraneSoftwrights.com/x/i/
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/x/
G. Ken Holman mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]