Identity transform
From Wikipedia, the free encyclopedia
In metadata, the identity transform is an example of a data transformation that copies the source data into the destination data without change.
Establishing an understanding the identity transformation is considered an essential process in creating a reusable Transformation library. By creating a library of variations of the base identity transformation, a variety of data transformation filters can be easily maintained. These filters can be chained together in a format similar to UNIX shell pipes.
[edit] Example using XSLT
The most frequently cited example of the identity transform is the "copy.xsl" transform as expressed in XSLT. This transformation uses the xsl copy command to perform the identity transformation:
<xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
This template works by first matching all attributes (@*) and then all nodes (node()) and than applying the copy transformation to all sub-nodes of the current data element. This recursively descends the data element hierarchy and outputs all structures in the same structure they were found in the original file.
[edit] See also
[edit] References
- The original reference to the copy transform in the w3c recommendation document
- Use of the identity transform is covered in the book XSLT Cookbook, O'Reilly Media, Inc., December 1, 2002, by Sal Mangano, ISBN 0-596-00372-2