home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _7702AB9026CD4925803704DFD1F81044 < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-20  |  1.1 KB  |  30 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--  generalize.xsl 1.0; 14 June 2001
  4.  | Convert specialied DITA topics into revertable, "generalized" form
  5.  |
  6.  | Copyright IBM Corporation, 2001, 2002
  7.  | This file is part of the DITA package on IBM's developerWorks site.
  8.  | See license.txt for disclaimers.
  9.  +======================================
  10.  |
  11.  *-->
  12.  
  13. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  14.      <xsl:output method="xml" indent="no"/>
  15.  
  16.      <xsl:template match="*[@class]">
  17.           <xsl:variable name="generalize" select="substring-before(substring-after(@class,'/'),' ')" />
  18.                 <xsl:element name="{$generalize}">
  19.                      <xsl:copy-of select="@*"/>
  20.                     <xsl:apply-templates/>
  21.                 </xsl:element>
  22.      </xsl:template>
  23.  
  24.      <xsl:template match="*|@*|comment()|processing-instruction()|text()">
  25.        <xsl:copy>
  26.          <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
  27.        </xsl:copy>
  28.      </xsl:template>
  29. </xsl:stylesheet>
  30.