xsl-list
[Top] [All Lists]

RE: sum function and math expressions

2005-04-08 09:17:06
Hi,

Here is another transformation that is not reversible:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>

However, I suspect Omprakash means to exclude such cases.

Maybe the question should be reduced to:

"What information is arguably lost in the identity transform?"

This list would include:

names, use and occurrence of entities in original
namespaces in original
attribute order
attribute value whitespace
aspects of the arrangement of infoset items in the source
  (e.g. whether an attribute was defaulted in a DTD)

Within the restricted world-view of XSLT, of course (which we frequently adopt happily) the answer is "nothing", insofar as "information" is defined as "that which has been expressed in an XML information set (as implemented by a conformant XSLT processor). An XSLT processor knows nothing of anything else.

Likewise, when baking cookies, you don't expect that you'll be able to look at a cookie and read what was written on the butter wrapper. (I know you expect to be able to freeze the butter and still read the label, but I submit that XSLT is more like baking the butter into cookies than like freezing it.)

These issues are what make XSLT possibly less than well-suited for stateful applications such as editors (to say nothing about HTML as a user interface :-).

Cheers,
Wendell

At 07:21 AM 4/8/2005, Mike wrote:
In general XSLT transformations are not reversible.

For example, the following transformation is obviously non-reversible:

<xsl:template match="/">
<z><xsl:value-of select="count(//*)"/></z>
</xsl:template>

There may be some transformations that are reversible, but as with any other
programming language, you will have to write the reverse transformation by
hand.


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--