OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Streaming Transformations for XML

[ Lists Home | Date Index | Thread Index ]
  • To: "Petr Cimprich" <petr@gingerall.cz>, <xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] Streaming Transformations for XML
  • From: "Gert Baudoncq" <Gert.Baudoncq@wkeltp.com>
  • Date: Wed, 13 Feb 2002 16:01:56 +0100
  • Thread-index: AcG0lSjCaHhgi85nQsedAiQRNXx1NwAB+4uQ
  • Thread-topic: [xml-dev] Streaming Transformations for XML

Hi,

As far as I know the streaming principle is nowhere more elaborated then
in the OmniMark programming language. 
Combined with their powerful pattern matching you can solve XML
programming problems very neatly. (fast, robust and memory inexpensive)
They don't use XML syntax but once you understand the streaming
principle (this is really very important) the syntax is easy to learn
and the learning curve is not too high.
You can find more information on their website http://www.omnimark.com
and you can always contact their sales people. They are very willing to
answer all your questions.
Btw, I'm not an OmniMark employee but a convinced user.

Best regards,
Gert

-----Original Message-----
From: Petr Cimprich [mailto:petr@gingerall.cz] 
Sent: woensdag 13 februari 2002 14:43
To: xml-dev@lists.xml.org
Subject: [xml-dev] Streaming Transformations for XML

I'm playing with an idea of a streaming transformation language. I don't

mean things like forward-only streamable subsets of XSLT or building 
subtrees on request only, but an alternative language designed for 
streaming transformations. From a bit different point of view, it would 
be a language to define SAX filters.

Such a hypothetic languge (let me call it STX) could use an XML, 
XSLT-like syntax with templates. However, the meaning of templates would

be quite different from this of XSLT. Matching expressions could 
consists of SAX-related axes and simple, XPath-like identifier, for
example.

STX transformations will be, of course, much less powerful than XSLT; it

will be as powerful as a SAX filter can be. On the other hand, the new 
language could provide an memory inexpensive way to handle simplier 
transformation.

Instead of a BNF definition, I append an example processed by 
non-existing STX processor. It should provide you with some very basic 
feeling about a possible syntax and semantics of the language.

I wonder whether the benefits of having simple streaming transformations

worth to learn a new language (and to implement a processor). Also, I 
haven't been able to find a similar solution or idea on the Net, but I 
expect there must a similar effort in the huge XML community. So, any 
pointers are welcome to prevent me from reinventing the wheel.

Regards,
Petr

--------------

* Example

** Transformation:

<stx:transform xmlns:stx="some_namespace_here">

  <stx:variable name="date" select="'Monday'"/>

  <stx:template match="element-start::list">
    <stx:copy-of attributes="all">
      <stx:attribute name="date" select="$date"/>
    </stx:copy-of>
  </stx:template>

  <stx:template match="element-end::list">
    <stx:copy-of/>
  </stx:template>

  <stx:template match="element-start::item">
    <stx:copy-of/>
    <id><stx:value-of select="@id"/></id>
    <stx:if test="@id=2">
      <note>the item we have been looking for</note>
    </stx:if>
  </stx:template>

  <stx:template match="element-end::item">
    <date><stx:value-of select="$date"/></date>
    <stx:copy-of/>
  </stx:template>

  <stx:template match="character::*">
    <text><stx:copy-of/></text>
  </stx:template>

</stx:transform>

** Input data:

<list id="19">
  <item id="1">A</item>
  <item id="2">B</item>
  <item id="3">C</item>
</list>

** Output:

<list id="19" date="Monday">
  <item>
    <id>1</id>
    <text>A</text>
    <date>Monday</date>
  </item>
  <item>
    <id>2</id>
    <note>the item we have been looking for</note>	
    <text>B</text>
    <date>Monday</date>
  </item>
  <item>
    <id>3</id>
    <text>C</text>
    <date>Monday</date>
  </item>
</list>

-- 
Petr Cimprich
Ginger Alliance
www.gingerall.com



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








 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS