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: XMLDEV <xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] Streaming Transformations for XML
  • From: Jandia Cyril <cjandia@logfi.fr>
  • Date: Thu, 14 Feb 2002 12:29:48 +0100
  • Importance: Normal
  • In-reply-to: <3C6A8430.8020702@dyomedea.com>

Hi again Petr ;o) - Hi all,

> From: Petr Cimprich <petr@gingerall.cz>
> To: "'xml-dev@lists.xml.org'" <xml-dev@lists.xml.org>
> Subject: [xml-dev] Streaming Transformations for XML
> I'm playing with an idea of a streaming transformation language.
> [...]
> Petr Cimprich
> Ginger Alliance
> www.gingerall.com

Making the assumption STX will be useful on its own (as soon as precisely
described :-) here are some "day after" thoughts (in no particular order)
about it - in the hope of helping it, while keeping it as simple as it
is/possible :

I have a problem with your "stx:copy-of" operator.

Don't you think it would be quite difficult to give it precise and simple
semantics if you let it as it is now? I mean : under the form of an

What's the point? Well, as I understand it now, it is free to appear (or
not) at beginning/end of a stx:template's child list. So, what happens if
you omit it in either of these template occurrences :

<stx:template match="element-start::an-element-type">


<stx:template match="element-end::an-element-type">

Then, I foresee you'll have to add many usage conditions for
restricting/controlling its appearance in context, in order for it to have
determistic effect, won't you?

Thus, I guess it would be more unambiguous to re-introduce it (from its
STX-transform-operator nature point of view) as an attribute : copy="yes|no"
now here's your transform sample, back, in STX, say "version 0.2" (which is
shorter/simpler) :

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

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

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

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

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

  <!-- and why not RegExp, BTW ?
  ("$1" in "<stx:value-of select..." gets its value from the regexp pattern
(in parenthesis) of
   "<stx:template match='...'") -->
  <stx:template match="character::(.*)">
    <text><stx:value-of select="$1"/></text>


Also, what do you think of this RegExp idea ? I like it.
But, am I not off topic (concerning envisioned STX simplicity) ?

PS :
Finally, I propose to add the following to your list of "SAX axes" :
"after-element-start::" (as a synonym of "element-start::"),
"before-element-end::" (as a synonym of "element-end::"),
and "before-element-start::", "after-element-end::" (for completeness).

Does all that make sense ?

Cyril Jandia
Author of ESPX/TinyXSL


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

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