xsl-list
[Top] [All Lists]

RE: [xsl] Identity and Modified identity transforms

2007-12-03 03:32:24
I've aways considered the "Modified Identity" pattern to be 
the identity template that walks the following sibling axis:

<xsl:template match="node()">
      <xsl:copy>
              <xsl:copy-of select="@*"/>
              <xsl:apply-templates select="node()[1]"/>
      </xsl:copy>
      <xsl:apply-templates select="following-sibling::*[1]"/>
</xsl:template>


I usually use "modified identity transform" to mean an identity template
supplemented by additional templates for specific nodes" - but of course the
term is very general and could mean anything.

The pattern above is one I usually refer to as "sibling recursion". Since
that also covers use of any templates in a sibling-based tree walk, it
should perhaps be "sibling recursion using identity template".

I don't think you should be mixing "node()" and "*" like that...

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
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>
--~--