[dsdl-discuss] Couple of additional use cases for the interoperability framework

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Thu Jun 27 2002 - 12:13:33 UTC

Gathered on xml-dev...

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
------------------------------------------------------------------------

attached mail follows:


On Thu, 2002-06-27 at 13:30, Jonathan Borden wrote:

> Recognizing and processing natural language is something that's been done
> for a couple of decades -- albeit imperfectly -- and as I am sure you are
> aware, the grammar(s) are complicted -- what is generally needed is some
> notion of the intended semantics of the sentences. In any case, this example
> isn't a good use case for XML schema languages and 'validity'.

No, but it is a good use case for extensibility in XML schema languages.

If you are happy with the result of the unix "file" command to determine
the type of a text and see if it's more likely a Java source code, a
snippet of Python or an English text, you may want to validate the
document using its result instead of the code.

I am actually considering implementing pyxie based transformations into
xvif to allow this kind of features:

http://bugzilla.xmlschemata.org/cgi-bin/bugzilla/show_bug.cgi?id=14

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
------------------------------------------------------------------------
-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>
The list archives are at http://lists.xml.org/archives/xml-dev/
To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>

attached mail follows:


Hi Jeni,

On Wed, 2002-06-26 at 15:34, Jeni Tennison wrote:

> For example, if you had something like:
>
> <length>12.5<unit>cm</unit></length>

Note that this model is only a (simple) XSLT transformation away from
something more "classical" and that (for instance)

     <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
      <xsl:template match="length/text()[normalize-space()]">
       <value>
        <xsl:value-of select="."/>
       </value>
      </xsl:template>
      <xsl:template match="*|@*">
      <xsl:copy>
       <xsl:apply-templates select="@*|*|text()"/>
      </xsl:copy>
     </xsl:template>
    </xsl:transform>

would transform it into

<length><value>12.5</value><unit>cm</unit></length>

which is much easier to validate with any schema language.

That's here that xvif can help and let you write:

<?xml version="1.0" encoding="iso-8859-1"?>
<element xmlns="http://relaxng.org/ns/structure/1.0" name="length">
  <if:transform type='http://www.w3.org/1999/XSL/Transform'
     xmlns:if='http://namespaces.xmlschemata.org/xvif/iframe'>
    <if:apply xmlns="">
     <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
      <xsl:template match="length/text()[normalize-space()]">
       <value>
        <xsl:value-of select="."/>
       </value>
      </xsl:template>
      <xsl:template match="*|@*">
      <xsl:copy>
       <xsl:apply-templates select="@*|*|text()"/>
      </xsl:copy>
     </xsl:template>
    </xsl:transform>
    </if:apply>
  </if:transform>
  <element name="value">
   <text/>
  </element>
  <element name="unit">
   <text/>
  </element>
</element>

(this is embedded into Relax NG but I am pretty confident that this
could be implemented on top of WXS as well).

Eric

PS: you can try it on
http://downloads.xmlschemata.org/python/xvif/tryMe.cgi

-- 
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
------------------------------------------------------------------------
-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>
The list archives are at http://lists.xml.org/archives/xml-dev/
To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>
--
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 27 08:13:36 2002

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