⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extract.xsl

📁 a a a a a a a a a a a a a a a a a a a a a a
💻 XSL
字号:
<?xml version="1.0"?><!-- Copyright (C) 2006 Ferdinand Prantl <prantl@users.sourceforge.net> -->
<!-- All rights reserved. -->
<!-- -->
<!-- This work is licensed under a Creative Commons Attribution 2.5 --><!-- License. See the attached file LICENSE for more information. --><!-- See also http://creativecommons.org/licenses/by/2.5/. --><!-- -->
<!-- See http://domino-javadoc.sourceforge.net for the most recent version -->
<!-- and more information. -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:dxl='http://www.lotus.com/dxl'>
<xsl:output method="xml" encoding="utf-8" />
<xsl:template match="/">
  <xsl:apply-templates select="dxl:document/dxl:item[@name='Body']/dxl:richtext" />
</xsl:template>

<!-- par(# doclink(# <par>) urllink(# <par>) run(# font <par>) span(# <par>)
       break anchor horizrule nonxmlchar namedlelementlink(# <par>))
     table (tablerow(tablecell(par table)) -->
<xsl:template match="dxl:richtext">
  <xsl:element name="description">
    <xsl:attribute name="id"><xsl:value-of select="/dxl:document/dxl:noteinfo/@unid" /></xsl:attribute><xsl:text>
</xsl:text>
    <xsl:apply-templates select="dxl:par | dxl:table" />
  </xsl:element>
</xsl:template>
<xsl:template match="dxl:par[.='' or .='Example' or .='See Also' or .='Language cross-reference' or preceding-sibling::node()='Language cross-reference']">
</xsl:template>
<xsl:template match="dxl:par[preceding-sibling::node()='See Also']">
  <xsl:apply-templates>
    <xsl:with-param name="element" select="'see'" />
  </xsl:apply-templates>
</xsl:template>
<xsl:template match="dxl:par">
  <xsl:element name="paragraph"><xsl:text>
</xsl:text>
    <xsl:variable name="def" select="@def" />
    <xsl:choose>
      <xsl:when test="preceding-sibling::node()[@id=$def]/@list='bullet'">
        <xsl:apply-templates>
          <xsl:with-param name="element" select="'item'" />
        </xsl:apply-templates>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:element>
  <xsl:if test="parent::node()[local-name() != 'tablecell']">
    <xsl:text>
</xsl:text>
  </xsl:if>
</xsl:template>
<xsl:template match="dxl:run[.='' or .='Example']">
</xsl:template>
<xsl:template match="dxl:run[.!='' and .!='Example']">
  <xsl:param name="element" select="'text'" />
  <xsl:param name="id" />
  <xsl:element name="{$element}">
    <xsl:choose>
      <xsl:when test="$id">
        <xsl:element name="link">
          <xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
          <xsl:apply-templates />
        </xsl:element>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:element><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="dxl:run[.!='' and .!='Example' and (./dxl:font[@style='bold' or @size='11pt'])]">
  <xsl:choose>
    <xsl:when test="ancestor::*[local-name() = 'tablecell']">
      <xsl:element name="text"><xsl:apply-templates /></xsl:element>
    </xsl:when>
    <xsl:when test="text() = 'Note'">
      <xsl:element name="text"><xsl:apply-templates /><xsl:text>:</xsl:text></xsl:element>
    </xsl:when>
    <xsl:otherwise>
      <xsl:element name="title"><xsl:apply-templates /></xsl:element>
    </xsl:otherwise>
  </xsl:choose><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="dxl:run[.!='' and .!='Example' and ./dxl:font[@name='monospace']]">
  <xsl:element name="code"><xsl:apply-templates /></xsl:element><xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="dxl:break">
  <xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="dxl:doclink">
  <xsl:param name="element" select="'text'" />
  <xsl:apply-templates>
    <xsl:with-param name="element" select="$element" />
    <xsl:with-param name="id" select="@document" />
  </xsl:apply-templates>
</xsl:template>
<xsl:template match="dxl:table">
  <xsl:element name="table"><xsl:text>
</xsl:text>
    <xsl:apply-templates select="dxl:tablerow" />
  </xsl:element><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="dxl:tablerow">
  <xsl:element name="row"><xsl:text>
</xsl:text>
    <xsl:apply-templates select="dxl:tablecell" />
  </xsl:element>
</xsl:template>
<xsl:template match="dxl:tablecell">
  <xsl:element name="cell"><xsl:text>
</xsl:text>
    <xsl:apply-templates select="dxl:par | dxl:table" />
  </xsl:element>
</xsl:template>

</xsl:stylesheet>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -