[dsdl-discuss] Re: Pre Ann: xvif (XML Validation Interoperability Framework)

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Thu Jun 20 2002 - 12:58:44 UTC

On Thu, 2002-06-20 at 12:59, Eric van der Vlist wrote:

> A verbose and not so elegant way to do so could be:
>
I think have a much better idea to keep it non intrusive by
"redeploying" the xvif elements.

First, a non xvif Relax NG processor will parse

<element xmlns="http://relaxng.org/ns/structure/1.0" name="foo"
 xmlns:if='http://namespaces.xmlschemata.org/xvif/iframe'>
 <if:whatever/>
 <text if:ignore="true"/>
</element>

as element foo {text}

and there is no need to worry about embeddeded if:whatever and text in a
choice.

Secondly, xvif processors may be instructed to ignore any RNG pattern
with a if:ignore attribute equal to "true". It can be done at parse time
and there is no need to use a choice either.

The proper way to do so seems then to completely embed the xvif pattern
definition into a single element. This can be done using the xvif
elements with their current semantic into:

<if:pipe>
 <if:transform
   type='http://namespaces.xmlschemata.org/xvif/regexp'
   apply='s/,/ /'/>
 <if:validate
  type=http://relaxng.org/ns/structure/1.0'>
  <list>
    <oneOrMore>
      <choice>
        <value>foo</value>
        <value>bar</value>
      </choice>
    </oneOrMore>
  </list>
 </if:validate>
</if:pipe>

An option to keep it less verbose being to say that <if:validate
type=http://relaxng.org/ns/structure/1.0'> can be assumed when we
encounter a Relax NG element in a pipe but this is syntactical sugar.

All together:

The definition would be:

<element xmlns="http://relaxng.org/ns/structure/1.0" name="foo"
 xmlns:if='http://namespaces.xmlschemata.org/xvif/iframe'>
 <if:pipe>
  <if:transform
    type='http://namespaces.xmlschemata.org/xvif/regexp'
    apply='s/,/ /'/>
  <if:validate
   type=http://relaxng.org/ns/structure/1.0'>
   <list>
     <oneOrMore>
       <choice>
         <value>foo</value>
         <value>bar</value>
       </choice>
     </oneOrMore>
   </list>
  </if:validate>
 </if:pipe>
 <text if:ignore="true"/>
</element>

With a potential shortcut as:

<element xmlns="http://relaxng.org/ns/structure/1.0" name="foo"
 xmlns:if='http://namespaces.xmlschemata.org/xvif/iframe'>
 <if:pipe>
  <if:transform
    type='http://namespaces.xmlschemata.org/xvif/regexp'
    apply='s/,/ /'/>
  <list>
    <oneOrMore>
      <choice>
        <value>foo</value>
        <value>bar</value>
      </choice>
    </oneOrMore>
  </list>
 </if:pipe>
 <text if:ignore="true"/>
</element>

Eric

-- 
See you in San Diego.
                               http://conferences.oreillynet.com/os2002/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(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 Thu Jun 20 08:58:46 2002

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