Changeset 20415

Show
Ignore:
Timestamp:
06/30/07 12:14:14 (1 year ago)
Author:
patrick
Message:

Simplify the code for removing the jconf:device_host elements by using
recursive template application.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vrjuggler/data/xslt/2.2-2.3.xsl

    r20411 r20415  
    186186   </xsl:template> 
    187187 
     188   <xsl:template match="jconf:device_host" /> 
     189 
    188190<!-- EVERYTHING ELSE ======================================================= --> 
    189191   <!-- 
     
    192194   <xsl:template match="*"> 
    193195      <xsl:choose> 
     196         <!-- 
     197            When a node has a jconf:device_host child, we copy its attributes 
     198            and proceed with a recursive template application. The template 
     199            above that matches jconf:device_host takes care of deleting it. 
     200         --> 
    194201         <xsl:when test="count(./jconf:device_host) &gt; 0"> 
    195202            <xsl:message> 
     
    198205            </xsl:message> 
    199206            <xsl:element name="{name()}"> 
    200                <xsl:attribute name="name"> 
    201                   <xsl:value-of select="@name" /> 
    202                </xsl:attribute> 
    203                <xsl:attribute name="version"> 
    204                   <xsl:value-of select="@version" /> 
    205                </xsl:attribute> 
    206                <xsl:for-each select="./*"> 
    207                   <xsl:variable name="elt_name"> 
    208                      <xsl:value-of select="name(.)" /> 
    209                   </xsl:variable> 
    210                   <xsl:if test="$elt_name != 'device_host'"> 
    211                      <xsl:copy-of select="." /> 
    212                      <xsl:value-of select="$newline" /> 
    213                   </xsl:if> 
    214                </xsl:for-each> 
     207               <xsl:copy-of select="./@*" /> 
     208               <xsl:apply-templates /> 
    215209            </xsl:element> 
    216210         </xsl:when>