Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xslt 包含另一个XSL文件时,XSL纯文本缩进_Xslt - Fatal编程技术网

Xslt 包含另一个XSL文件时,XSL纯文本缩进

Xslt 包含另一个XSL文件时,XSL纯文本缩进,xslt,Xslt,我有一个纯文本XSL模板,它工作良好,不缩进 然后,我向该模板添加了另一个XSL模板,如下所示: <xsl:copy-of select="document('AboutThisMessagePlainText.xsl')"></xsl:copy-of> 呈现XSL时,AboutThisMessagePlainText.XSL文件中的文本将缩进 我怎样才能防止这种情况 我的完整XSL是: <xsl:transform version="1.0" xmlns:x

我有一个纯文本XSL模板,它工作良好,不缩进

然后,我向该模板添加了另一个XSL模板,如下所示:

<xsl:copy-of select="document('AboutThisMessagePlainText.xsl')"></xsl:copy-of>

呈现XSL时,AboutThisMessagePlainText.XSL文件中的文本将缩进

我怎样才能防止这种情况

我的完整XSL是:

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no" />
<xsl:template match="/Email">
<xsl:text>To Our Valued Customer:</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>Welcome, and thank you .....blah blah blah</xsl:text>
<xsl:text>Sincerely,</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>My Company</xsl:text>
<xsl:copy-of select="document('AboutThisMessagePlainText.xsl')"></xsl:copy-of>
</xsl:template>
</xsl:transform>

对于我们的尊贵客户:




欢迎,谢谢……等等等等
真诚地




我的公司
关于此消息plaintext.xsl是:

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no" />
<xsl:template match="/">
<xsl:text>About This Message</xsl:text>
<xsl:text>You received this email because you subscribed to our electronic notification service. If you no longer wish to receive electronic notifications, etc...</xsl:text>
</xsl:template>
</xsl:transform>

关于这个消息
您收到此电子邮件是因为您订阅了我们的电子通知服务。如果您不再希望收到电子通知等。。。
预期输出结果为:

对于我们的尊贵客户:

欢迎,谢谢……等等等等

真诚地

我的公司关于此邮件您收到此电子邮件是因为您 已订阅我们的电子通知服务。如果你不再 希望收到电子通知等

然而,关于这条消息,你收到了。。。它们是缩进的

谢谢


我最终通过将AboutThisMessagePlainText.xsl更改为文本文件来解决这个问题。这样可以防止文本缩进

文本文件如下所示:

<text>



About This Message

You received this email because you subscribed to our electronic notification service. If you no longer wish to receive electronic notifications, etc...
</text>

关于这个消息
您收到此电子邮件是因为您订阅了我们的电子通知服务。如果您不再希望收到电子通知等。。。

请向我们展示一个关于此MessagePlainText.xsl的示例,然后解释该文件的输出在纯文本结果中的外观。