[dsdl-discuss] Re: Interoperability framework: getting started again

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Tue Mar 11 2003 - 11:45:38 UTC

Hi Martin,

On Tue, 2003-03-11 at 09:28, Martin Bryan wrote:
> Eric
>
> Re
>
> <framework>
> <rule>
> <instance>
> <split split="document('split.xxx')"/>
> </instance>
> <assert>
> <isValid schema="document('schema1.rng')" instance="instance[1]"/>
> <isValid schema="document('schema1.rng')" instance="instance[2]"/>
> </assert>
> </rule>
> </framework>
>
> and
>
> >Alternatively, transformation results can be stored in variables:
>
> <framework>
> <variable name="mySchema">
> <transform instance="document('master.rng')"
> transformation="document('getstage.xsl')">
> <with-param name="stageName" select="'post-floob'"/>
> </transform>
> </variable>
> <rule>
> <assert>
> <isValid schema="$mySchema"/>
> </assert>
> </rule>
> </framework>
>
> >These are just some few initial examples, but I'd like to get your
> feelings at this stage!
>
> My initial feeling is that you need to be careful about identification of
> variables, assertions, their inputs and outputs. It is one thing to allow
> sequences where the output of one process is passed on to the next process
> *at the same level or defined as an ancestor*. It is another thing to allow
> arbitrary creation of output subsets and then reapply them, particularly if
> they are to be reapplied at multiple places, as the first example seems to
> imply.

Yes, and that's not my purpose: my intention is to keep the same kind of
rules as in XSLT or Relax NG and the variables would be global as in the
first example.

> Some specific questions. In the split example, where do instance[1] and
> instance[2] come from? How to they get named? Which tree are they counted
> in, and how is that tree identified? (There is only one instance element in
> this framework, so instance[2] is a mystery to me!)

Agreed, I think a longer explanation is deserved :-) ...

There is the "original instance" and each rule can define its own
instance as the result of the transformation of the original instance.

My assumption is that we need to be able to refer to:

 - the instance document for the current rule,
 - the results of a split of the instance document for the current rule,
 - external schemas,
 - global variables,
 - the original instance document (?)
 - maybe more (?) ...

I think that instead of reinventing a syntax to do so we could use XPath
(or a subset of XPath) expression over the context expressed as a
virtual XML document.

The model of this document could be:

<framework>
 <instance> ... original instance ... </instance>
 <rule> <!-- Current rule, also the context node -->
  <instance> ... instance for the current rule ... </instance>
 </rule>
</framework>

When the transformation performs a split (like Relax Namespaces), there
are as many instance for the rule as needed.

This means that:

      * /framework/instance refers to the original instance
      * instance refers to the instances for the current rule as defined
        in the instance element for the rule (which is by default the
        original instance).
      * instance[1] refers to the first of these instances.
      * $myVariable refers to the variable "myVariable".
      * document('schema.rnc') refers to the external document
        'schema.rnc'.
      * we may also want to give access to content of the instance and
        write stuff such as:

 <framework>
  <rule>
   <assert>
    <isValid schema="document('schema-head.rng')" instance="instance/xhtml:html/xhtml:head"/>
    <isValid schema="document('schema-body.rng')" instance="instance/xhtml:html/xhtml:body"/>
   </assert>
  </rule>
 </framework>

> What happens if the contents of a variable is to be used as the input for a
> subsequent transformation?

I am not sure I get the question. I have given up the idea of defining
pipes and I don't see what you mean.

You can use a variable as an instance, a schema or to define a new
variable.

> Can it be written back to a variable with the
> same name?

No.

> If so, what controls which version an assertion works with? Is it
> always to be the last version of the variable defined before the rule is
> invoked? If so can I have <variable>...<rule>...<variable>...<rule>
> sequences?

No, I had in mind to keep all the variables and rules global and their
order would not be significant.

Does that make more sense?

> Martin Bryan
>
>
>
> --
> 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)

-- 
Did you know it? Python has now a Relax NG (partial) implementation.
                                          http://advogato.org/proj/xvif/
------------------------------------------------------------------------
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 Tue Mar 11 12:45:39 2003

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