[dsdl-discuss] Re: Draft of Part 7 Character Repertoire Valdiation

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Wed Apr 07 2004 - 12:46:02 UTC

On Wed, 2004-04-07 at 13:39, Eric van der Vlist wrote:

> In fact, I think that it's the semantic of test="pattern" when the
> context node isn't a simple type element that should be clarified.

Still thinking loudly about that, with Schematron/xpath, when we write:

<sch:rule context="foo">
  <sch:assert test="@bar > 1">
    Attribute bar should be greater than one
  </sch:assert>
</sch:rule>

We use XPath to set the context node (foo) and XPath again to set the
context on which to evaluate a test (@bar) and the test itself.

With this new proposal, when we write:

<sch:rule context="foo">
  <sch:assert test="\p{IsBasicLatin}">
    Should be BasicLatin
  </sch:assert>
</sch:rule>

We use XPath to set the context node but miss a way to set the context
of the test "\p{IsBasicLatin}" (does it apply to attribute bar, to all
its text children, to all its descendants, to its text value, ... ?).

In fact, we would need an additional XPath function "match(nodeset,
pattern)" or "match(string, pattern)" rather than a pattern only.

That being said, both XPath 2.0 and STX have such functions, see
      * http://www.w3.org/TR/xquery-operators/#func-matches
      * http://stx.sourceforge.net/documents/#string-functions

In other words, I think that you've proved that we can do character
repertoire validation using Schematron hosting either XPath 2.0 or STX.

Now, Schematron hosting either XPath 2.0 or STX can do much more than
character repertoire validation and it might be considered as overly
complex (and costly) to do so when a simple language that could be
implemented as a trivial SAX filter could meet most of the use cases.

Eric

-- 
Did you know it? Python has now a Relax NG (partial) implementation.
                                          http://advogato.org/proj/xvif/
Upcoming XML schema languages tutorial:
 - Amsterdam   -half day- (18/04/2004)        http://masl.to/?P220516D7
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
--
DSDL members discussion list
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-discuss-request@dsdl.org
(mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)
Received on Wed Apr 7 14:46:03 2004

This archive was generated by hypermail 2.1.8 : Fri Dec 03 2004 - 14:00:28 UTC