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

Declarative language for reversible transformations?

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 30 Nov 2018 12:48:38 +0000

Declarative language for reversible transformations?

Hi Folks,

I am seeking a powerful, declarative XML language for expressing reversible transformations.

Here is an example to illustrate what I mean by reversible transformation. Input files contain an integer denoting a machine: 0 denotes Intel 386, 1 denotes x86, 2 denotes ARMv7. Here is an input file transformed to XML:

1 à foo à <machine>x86</machine>

 

where foo is some (to-be-determined) declarative, XML language.

 

Here is the reverse transformation, from XML to original input format:

 

<machine>x86</machine> à foo à 1

 

To do this reversible transformation, foo must have (declaratively) captured the mapping from integers to strings (e.g., 1 -> x86).

 

That level of reversible transformation is already possible using the declarative, XML language Data Format Description Language (DFDL). DFDL calls these transformations parsing and unparsing.

 

Here is an example of a more advanced reversible transformation. An input file has this:

 

W014404 1217          

 

where:

W means West
014404 means 14 degrees, 40.4 minutes
1217 means the month and year of variation (e.g., December 2017)

The input file is transformed to this XML:

<magneticVariation>
   
<magneticVariationEW>West</magneticVariationEW>
   
<magneticVariationValue>15.0</magneticVariationValue>
</magneticVariation>

The reverse transformation takes the XML back to the original input format.

To do this reversible transformation, a language must have (declaratively) expressed:

  • the mapping from characters to strings (e.g., W -> West)
  • the mapping from degrees/minutes to decimal degrees (e.g., 014404 -> 15.0)
  • the mapping from month/year of variation to null (e.g., 1217 -> null)


That kind of reversible transformation requires a powerful language. Unfortunately, DFDL cannot (yet) express that kind of reversible transformation.

Do you know of a powerful, declarative, XML language for expressing reversible transformations?

/Roger



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