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

RE: In converting XML instance A to XML instance B, this propertymust be

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 29 Nov 2013 19:17:20 +0000

RE: In converting XML instance A to XML instance B

Thanks Ken, Steve, and Michael for your outstanding feedback.

 

I think that I’ve got it. I’d appreciate it if you (and others) would check my thinking.

 

Please allow me to describe the path that led to my question.

 

When I spoke of “conversion” in my original post, I was thinking of the kind of conversion that a compiler does: convert from one form into an equivalent form (e.g., convert source code into equivalent assembly code). The conversion process must ensure that the meaning in the source form is preserved in the destination form. Here’s a quote from the compiler book that I am reading[1]:

 

                The main aspect of conversion is that the

                input has a property called semantics – its

                “meaning” – which must be preserved by

                the process.

 

As I read that, it occurred to me that oftentimes we have the task of transforming an XML document into another equivalent form. And we expect the transformation process to preserve some property. Isn’t the property that we want preserved -- semantics?

 

If I write an XSLT program to transform this airport location:

 

                <Airport>

                      <ICAO>KBOS</ICAO>

                </Airport>

 

into an equivalent airport location, expressed in latitude and longitude, aren’t I expecting the XSLT program to produce a result that refers to the same location; namely, Boston’s Logan airport? That is, don’t I want the conversion process to preserve the location semantics?

 

I think that I see the fallacy of my thinking. To understand the fallacy we need to compare programs to XML instances.

 

When a program is evaluated it produces a value. [How the program is evaluated is specified in the programming language manual.] That value is the program’s semantics. When my compiler book says that semantics must be preserved, what it really means is that evaluating the destination code (e.g., assembly code) must produce the same value. If it does, then we say the semantics have been preserved.

 

However, XML is different. There isn’t the notion of: evaluate the XML instance to produce a value. Further, it is up to an application to decide upon the meaning of the XML instance. Once the application has decided upon a meaning, then it must ensure that that meaning is preserved in the transformation. For example, if the application decides that the meaning of:

 

                <Airport>

                      <ICAO>KBOS</ICAO>

                </Airport>

 

is that it expresses the location of an airport, then when it transforms the XML into an equivalent XML where the location is expressed in latitude and longitude:

 

                <Airport>

                      <Latitude>42.3631° N</Latitude>

                      <Longitude>71.0064° W</Longitude>

                </Airport>

 

the application must ensure that the destination XML refers to the same location as the source XML; namely, both the source XML instance and the destination XML instance refers to Boston’s Logan airport. Thereby the location semantics are preserved.

 

Does that sound about right?

 

/Roger

 

[1] Modern Compiler Design, http://www.amazon.com/Modern-Compiler-Design-Dick-Grune/dp/1461446988/ref=sr_1_1?ie=UTF8&qid=1385747695&sr=8-1&keywords=modern+compiler+design

 

 



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