[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A dandy little technique for constraining your stringsto A

  • From: Wendell Piez <wapiez@wendellpiez.com>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Thu, 22 Oct 2015 15:43:50 -0400

Re:  A dandy little technique for constraining your stringsto A
xml-dev,

I'm a big fan of layered validation, but I hasten to add two things (no, three):

1. Although it may help to formalize interfaces in a way that might be
useful (for the only thing that really matters, negotiation), the idea
doesn't really, despite Rick's characterization, address Postel's Law,
which is not about how to design or build, but about how to work in
the space where a formal or nominal design has failed. Where, for
example, the spec says "use a URI" or "use ASCII", without managing to
define clearly what that should be taken to mean. Whether to be
"conservative" or "liberal", in such a situation, should depend on
whether one is producing or receiving. But the very line between "what
should work" and "what shouldn't" is at issue only because it can
depend on who is doing the working.

When we can agree on what "URI" or "ASCII" or what-have-you should
mean, we have no problem. It's where we don't, that the principle of
"do unto others as you would have them do unto you" really becomes
important. (That would be an older formulation that amounts to the
same thing.)

2. Given this, it rankles me to hear that XML, for example, fails to
observe Postel's Law, because it mandates draconian error handling.
("Not only is XML mean to me, it makes me be mean to others.") This is
a non sequitur and the fact is the opposite. Because we have DEH
(among other reasons), the occasions where it is ambiguous whether
something is or is not XML, and of what sort, as presented to a
parser, are really quite rare. (Here we leave aside philosophical
issues as to whether XML is "really the model" or "really the
serialization", and address only the latter. Indeed the very fact that
we can reasonably suppose it is "really the model" is due to the parse
working as well as it does.) This narrows the murky grey in-between
zone where Postel's Law is the only thing we have to go on, at least
as far as it concerns XML, or at any rate, XML-as-XML. We just don't
have to fight over it.

3. Layered validation, similarly, is not a solution to the problem of
how to follow the so-called "Robustness Principle" (or how to know,
suppose or claim we are following it), but rather a strategy for
managing when we are likely to need it. The problem itself, considered
generally, does not admit of a formal, principled solution, and
cannot, precisely because it appears only in conditions of failure --
and we never know where those might occur, especially as the rules
become more complex and more players take to the field.

Regards, Wendell



On Thu, Oct 22, 2015 at 5:04 AM, Michael Kay <mike@saxonica.com> wrote:
>
> On 22 Oct 2015, at 01:29, Rick Jelliffe <rjelliffe@allette.com.au> wrote:
>
> If the schema is a published interface for a large system, rather than some
> changeable part inside a black box, then you should consider having a two
> layer schema.
>
>
>
> One idea I have been trying to develop is the idea of a “parameterized
> schema” where parameters supplied at validation time affect the constraints
> that are applied.
>
> I’ve made a start with this by allowing XSD 1.1 assertions to contain
> variables bound to parameters that can be supplied at schema validation
> time. But it could go a lot further, for example
>
> <pattern value=“\p{isBasicLatin}” use-when=“$conservative”/>
>
> Of course, it’s easy enough to implement this yourself with a preprocessor.
>
> Michael Kay
> Saxonica
>



-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^


[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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.