如何隐藏数据标签

时间:2019-06-25 07:57:51

标签: xslt xslt-1.0 xslt-2.0

我要HiddenData应该是Unerline标签

<ShortNote>
<CatchWord pos="1">Human and Civil Rights</CatchWord> &#8212; <CatchWord pos="2"><HiddenData>#Right to Information, Confidential Information and Data Protection &#8212; </HiddenData></CatchWord><CatchWord pos="3"><HiddenData># </HiddenData>Right to Information Act, 2005</CatchWord>
</ShortNote>

我正在尝试以下代码:-

<xsl:template match="ShortNote">
    <xsl:text>&#xA;</xsl:text>
    <xsl:for-each select="CatchWord/tokenize(., '&#8212;')">
        <xsl:element name="SNHeading{position()}">
            <xsl:value-of select="normalize-space(.)"/>
        </xsl:element>
    </xsl:for-each>
  </xsl:template>

我的输出如下代码:-

<SNHeading1>Human and Civil Rights</SNHeading1><SNHeading2>#Right to Information, Confidential Information and Data Protection</SNHeading2><SNHeading3></SNHeading3><SNHeading4>#Right to Information Act, 2005</SNHeading4>

但需要输出:-

<SNHeading1>Human and Civil Rights</SNHeading1><SNHeading2><u>#Right to Information, Confidential Information and Data Protection</u></SNHeading2><SNHeading3></SNHeading3><SNHeading4><u>#</u>Right to Information Act, 2005</SNHeading4>

0 个答案:

没有答案