[dsdl-discuss] Re: Strawman: bringing the framework inside schemas

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Thu May 30 2002 - 06:55:15 UTC

Hi Martin,

Martin Bryan wrote:
> Eric
>
>
>>Attached is a new version of my strawman including:
>>
>>- an example of implementation of Rick's unit/number proposal
>>- an example using STX
>>- some first considerations on implementation (I think that it
>> fits nicely with James' derivative algorithm.
>>
>
> Among the problems:
>
> You can''t use integer to validate dates - you have to use specific
> datatypes, with specific ranges. The key factor is that the ranges interact,
> so if the month is 2 then you can't have 30 or 31 in your day field, and you
> can only have 29 if the year is divisible by 4 but not by 100, etc.

This should just be considered as an example of what the framework could
look like. Not knowing which underlying type system will look like, I
have restricted myself to using existing technologies (ie W3C XML Schema
part 2, XPath, XSLT, STX, regular fragmentations, ...).

The purpose of this example was to show that if we decide that in our
type system a date time should be represented with its parts split into
different elements, the framework could still be used to transform ISO
8601 dates into this format.

But you're right to say that if the underlying type system is W3C XML
Schema part 2 the transformation isn't that usefull...

>
> You need to clearly indicate which part of DSDL each of the unqualified
> elements belongs to. (I presume the ie: entries in the Intro equate to the
> if: ones later in the spec, but am not sure where many of the others come
> from.) Where do fragmentRules, applyTo and produce all sit in the DSDL
> scheme of things?

Sorry for the typo, "ie" in the intro should be "if".

Otherwise, "all the examples are presented assuming the default
namespace is Relax NG" and the namespace for "fragmentRules" is
specified in the example:

<define name="foo">
   <if:process type="http://simonstl.com/ns/fragments/">
     <if:value>
      <fragmentRules xmlns="http://simonstl.com/ns/fragments/">
       <fragmentRule pattern="\s*([0-9]*)\s*(\S)*">
        <applyTo>
         <element nsURI="" localName="foo"/>
        </applyTo>
        <produce>
         <element nsURI="" localName="foo" prefix="">
          <attribute nsURI="" localName="unit" prefix="" />
         </element>
        </produce>
       </fragmentRule>
      </fragmentRules>
     </if:value>
     <element name="foo">
      <attribute name="unit">
        <data type="xs:NMTOKEN"/>
      </attribute>
      <data type="xs:decimal"/>
     </element>
   </if:process>
</define>

>
> The whole thing starts to look messy once you let any part of any standard
> nest. It would be neater to have the definitions in separate documents which
> get referenced where needed. This would seem to fit more neatly with OO
> principles.

Yes, I have included an example to show how this may be achieved:

<define name="foo">
   <if:process type="http://www.w3.org/1999/XSL/Transform">
     <if:value href="splitDate.xsl"/>
     <element name="foo">
      <element name="year">
        <data type="xs:integer"/>
      </element>
      <element name="month">
        <data type="xs:integer"/>
      </element>
      <element name="day">
        <data type="xs:integer"/>
      </element>
     </element>
   </if:process>
</define>

Thanks

Eric

> Martin
>

-- 
See you in San Diego.
                                http://conferences.oreillynet.com/os2002/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
--
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 Thu May 30 02:55:18 2002

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