[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Are we losing out because of grammars?
- From: Rick Jelliffe <ricko@allette.com.au>
- To: xml-dev@lists.xml.org
- Date: Thu, 01 Feb 2001 22:58:36 +0800
From: Paul Tchistopolskii <paul@qub.com>
> In your design it looks like Schematron is the 'owner',
> and TREX is the 'slave' == library for regular expressions
> ( because this is what TREX really is ). This gives
> us the "high-level language" == Schematron
> driving the show, and I don't like it.
Or really it is saying that the context selection mechanism mechanism (like
the left-hand side of a production) can be considered separate from the
right-hand side which makes certain assertions? In other words, that
XPaths are very nice for the selector, but it would be useful to have a
richer selections of possible assertions. That is very interesting to me: I
have been whinging that we need a schema framework language (where the
selection mechanism is independent of the typing from the assertion
languages) to support extensible schema languages, and perhaps Schematron
already provides such a thing under my nose!
From: James Clark <jjc@jclark.com>
> For TREX, at least, I can think of several ways in which you could
> integrate it with something like Schematron. For example, you could add
> a <validate> element to Schematron that would occur as a child of <rule>
> just like <assert> and <report>.
Actually, I have been considering something like this, for Schematron 1.6,
but
I have not wanted to do anything until Schematron 1.5 was birthed and
weaned.
{By the way, as a secret pre-announcement before tommorrow, the new
implementation of Schematron 1.5 is finally available, supporting phases
(i.e. command line selection of bundles of patterns to be validated, allows
workflow and different effective schemas during a documents lifetime),
better error handling, better message support, a pink bilby/bandicoot, and
merging the namespace/non-namespace branches, still very small code for what
it can do:
http://www.ascc.net/xml/resource/schematron/index.html#news }
What I was considering was simple picture datatypes along the lines of this
<rule context="x/y/z">
<picture variables="YYYY MM DD" mask="YYYY-MM-DD">
<assert test="($YYYY) > 2000" >Year must be in new </assert>
<assert test="($MM) = 11 or ($MM) = 12"
>Month must be November or December</assert>
</picture>
</rule>
which I believe could (changing as needed) be compiled into XSLT string
operations without tears. Some people prefer picture masks to regular
expressions (and, in any case, I would prefer to provide complementarity to
existing schema languages, even though obviously I think the rules-based
approach has the most potential.)
So James' <validate> idea would fit into that quite suitably (probably
<assert foreign="..."> and <report foreign="">... would be better tagnames
to keep the names used to the absolute minimum, since we still would be
making assertions). Sorry to discuss this on XML-DEV; I had better switch
to the Schematon mail list to persue this further.
Thanks for the ideas James and Paul!
Cheers
Rick Jelliffe