如何获取未包装在<p>标记中的文本以使用XSLT复制?

时间:2019-01-15 03:20:40

标签: xslt-2.0

我正在运行XSLT脚本,以将问题更新为较新的格式。作者未将说明包装在<p>标记中。当我运行脚本时,这些解释就消失了。如果我将它们包装在<p>标记中,那么它们的复制就可以了。我有1200个问题,所以我真的希望不必将所有的解释一一对应地包装在<p>标签中。

<!-- attributes, commments, processing instructions, text: copy as is -->
    <xsl:template match="@*|comment()|processing-instruction()|/text()">
        <xsl:copy-of select="."/>
    </xsl:template>


<xsl:if test="*[not(@property)]">
<section property="ktp:explanation-section" typeof="ktp:feedback" data-title="Feedback">
<xsl:attribute name="class">
     <xsl:text>ktp-explanation-section</xsl:text>
     <!-- append exclusion class, if any -->
     <xsl:if test="string-length($exclusions)!=0">
     <xsl:value-of select="$exclusions"/>
     </xsl:if>
     </xsl:attribute> 
     <xsl:attribute name="data-uuid">
      <xsl:call-template name="assignID"/>
            </xsl:attribute>
      <xsl:apply-templates select="*[not(@property)]|text()"/>
       </section>

0 个答案:

没有答案