[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Compile a transformation description into a largenumber of

  • From: "Liam R. E. Quin" <liam@fromoldbooks.org>
  • To: "Costello, Roger L." <costello@mitre.org>, "xml-dev@l..." <xml-dev@l...>
  • Date: Thu, 20 Dec 2018 15:09:53 -0500

Re:  Compile a transformation description into a largenumber of
On Thu, 2018-12-20 at 15:50 +0000, Costello, Roger L. wrote:
> Is there some small set of very simple operations that, when
> combined, can translate any XML vocabulary to another?

What you describe is very similar in principle to the bytecode that
Michael Kay has described as being used in the Saxon product.

> . Possibly the "transformation description" box shown above could be
> much more declarative than, say, a full-fledged XSLT program that
> transforms vocabulary 1 to vocabulary 2.

i am not sure about declarative programming on a spectrum, from "not
declarative" through "suggests being declarative" through "maybe
slightly declarative" all the way to "wonderfully declarative"?

> Have you thought of such things? Is there a small subset of very
> simple XSLT operations that can perform any transformation? Stated
> another way, is there a small subset of very simple XSLT operations
> that is "Turing Complete"? Have you ever created a compiler to output
> a large number of these very simple transform operations?

i've done it in other areas. You can end up with something like,
assembly code though, which is very far from high level.

If you go for something higher level, you end up with XSLT.

If you want something higher level than XSLT, you either end up with
something like XQuery (which isn't really higher level at all) or
something specialized and not generally applicable, or less powerful.

For example, you could write a language that said things like,

    element para becomes p
    element title becomes h2
    element title within document/metadata
        becomes title within html/head

if all you had to do was rename elements and move some about. But now
suppose you need to add a total to the order table, add a
class="negative" attribute to all transaction values that are negative,
make mentions of other chapters be links, split the input into a
separate HTML file per chapter with a table of contents... and you
quickly need something more general-purpose, so you're either back to
XSLT, or your higher-level language gets extended,
    element qv becomes a link to the corresponding target
with the generated code using the XML Schema to work out which
attribute to use to find the target, perhaps.

I don't know how much mileage there is in this. Maybe it'd end up
replicating the immense, detailed, careful and productive work that the
XSLT Working Group did over the past twenty years.

If you made a language that was high-level enough that the same input
description might work for HTML, JSON, JSON-LD, XML, RDF, then there
might be some interest. But that's quite a challenge, especially given
that you need the language to be usable by people other than its
designer ;)

Liam


-- 
Liam Quin, https://www.holoweb.net/liam/
Available for XML/Document/Information Architecture/
XSL/XQuery/Web/Text Processing/A11Y training & consulting.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.