我有一个 XLST 转换代码,它从元素列表中获取值
<NewSourceName>
<xsl:for-each select="CORRELATION/EXPLOITS/EXPLT_SRC/EXPLT_LIST/EXPLT">
<xsl:variable name="Source" select="../../SRC_NAME"/>
<xsl:variable name="Link" select="LINK"/>
<xsl:variable name="Description" select="DESC"/>
<xsl:variable name="Reference" select="REF"/>
<xsl:value-of select="concat('Source: ',$Source,' Reference: ',$Reference,' Description: ',$Description,' Link: ',$Link,' ')"/>
</xsl:for-each>
</NewSourceName>
此代码生成我需要的输出文本:
Source: The Exploit-DB Reference: CVE-2020-14882 Description: Oracle WebLogic Server 12.2.1.0 - RCE (Unauthenticated) - The Exploit-DB Ref : 49479 Link: http://www.exploit-db.com/exploits/49479 Source: The Exploit-DB Reference: CVE-2020-11022 Description: jQuery 1.2 - Cross-Site Scripting (XSS) - The Exploit-DB Ref : 49766 Link: http://www.exploit-db.com/exploits/49766
我确实尝试在字符串中添加 \n 或 <BR> 以添加换行符以在 RSA Archer 文本字段的“富文本字段”上获取此格式,但是在处理转换时会返回错误。
<xsl:value-of select="concat('<BR>Source: ',$Source,'\n Reference: ',$Reference,' Description: ',$Description,' Link: ',$Link,' ')"/>
我需要这样的文字
<p>Source: The Exploit-DB<br>
Reference: CVE-2020-14882<br>
Description: Oracle WebLogic Server 12.2.1.0 - RCE (Unauthenticated) - The Exploit-DB Ref : 49479<br>
Link: http://www.exploit-db.com/exploits/49479 </p>
<br>
<p>Source: The Exploit-DB <br>
Reference: CVE-2020-11022 <br>
Description: jQuery 1.2 - Cross-Site Scripting (XSS) - The Exploit-DB Ref : 49766 <br>
Link: http://www.exploit-db.com/exploits/49766<p>
任何想法?