[dsdl-discuss] Re: Datatypes

From: Martin Bryan <mtbryan@sgml.u-net.com>
Date: Wed May 29 2002 - 13:46:16 UTC

Rick

>For example, in my suggestion, validating
    <a b="0 1 2 3 4 5"/>
against the constraint that the odd numbers are in ascending order and the
even numbers are in ascending order (e.g. it could be an increasing line)
would
involve the steps

The problem in SVG is much more complex than that. As I said it is a
question of pairs, not tokens. So you have structures such as:
  <polygon points="5,5 5,15 15,5"> and
  <line x1="200" x2="200" y1="100" y2="300">

You might have a constraint that all lines are either vertical or
horizontal, which means that either x1 has to match x2 or y1 has to match
y2, or that all polygons are closed (though SVG will automatically close any
that aren't)

>1) Select the attribute value and send as XML document named
  by the type of the b attribute
   <eg:ascendingList>0 1 2 3 4 5</eg:ascendingList>

This implies some way, presumably known from the framework, whereby the
response to the parsing of this "XML document" will be returned to the
document it contains in a synchronized way. It also implies that there is
some link between the type names of the datatype specification and the "DTD"
used to validate the list. I'm not sure I like such "hidden links".

>2) Tokenize based on spaces and treat as numbers
   <dsdl:seq type="eg:ascendingList">
        <dsdl:number>0</dsdl:number>
        <dsdl:number>1</dsdl:number>
        <dsdl:number>2</dsdl:number>
        <dsdl:number>3</dsdl:number>
        <dsdl:number>4</dsdl:number>
        <dsdl:number>5</dsdl:number>
   </dsdl:seq>

Is the dsdl:seq the sequence element from Part 2 assigned to a revised
purpose, or an element defined in Part 5 for the spec for the purpose of
tokenizing a list of values?

>3) Validate the relationship with the Schematron rule
    <rule context="*[@type="eg:ascending:List]/dsdl:number[position() &gt;
2]">
        <assert test="
          number(dsdl:number[position () = current()/position()-2]/text())
          &lt; number(text())"
>Odd and even values should be in ascending order</assert>
    </rule>

So this rule would work just as well for <a b="-200 -101 2 43 40004
40005"/>. Um...

>So the selection is trivial. The tokenizing is trivial. And the Schematron
schema is no particular stretch.

>I will put up a more clear strawman, also responding to Eric's.

I shall look forward to seeing this. I have not responded to Eric's yet as I
am still trying to get my head around the problem of inter-relating the
various parts of the standard.

Martin

--
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 May 29 10:41:21 2002

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