“DTD禁止”调用XslCompiledTransform.Transform()时 [英] "DTD prohibited" when calling XslCompiledTransform.Transform()
本文介绍了“DTD禁止”调用XslCompiledTransform.Transform()时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用XSLT将HTML文件转换为XSL-FO。代码如下所示。
I am using XSLT to convert a HTML file to XSL-FO. The code is shown below.
| //加载FO样式表。 |
| XslCompiledTransform xslt = new XslCompiledTransform(); |
| xslt.Load(@ " PDF \xhtml-to-xslfo.xsl" ); |
| |
| //执行转换并将结果输出到文件。 |
| xslt.Transform(htmlFilePath,foFilePath); |
|
// Load the FO style sheet. | |
XslCompiledTransform xslt = new XslCompiledTransform(); | |
xslt.Load(@"PDF\xhtml-to-xslfo.xsl"); | |
// Execute the transform and output the results to a file. | |
xslt.Transform(htmlFilePath, foFilePath); | |
推荐答案
以前我使用的是以下HTML。
Previously I was using the following HTML.
< html xmlns = " http:// www。 w3.org/1999/xhtml" > |
< ; body > |
< table cellpadding = " 0" cellspacing = < font style ="color:blue">" 0" style = " font-size:10px" width = " 100%" ; > |
< tr style = < font style ="color:blue">" table-layout:fixed;字体大小:12像素; width:100%" > |
< td colspan = " 2" style = < font style ="color:blue">" width:30%" > |
& nbsp; < strong > 付款方式编号 < / strong > < / td > |
< / tr > |
<! - ...更多html来这里...... - > |
< / 表 > |
< / body > |
< / html > |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<body> |
<table cellpadding="0" cellspacing="0" style="font-size: 10px" width="100%"> |
<tr style="table-layout: fixed; font-size: 12px; width: 100%"> |
<td colspan="2" style="width: 30%"> |
<strong>Payment No.</strong></td> |
</tr> |
<!-- ... more html comes here ... --> |
</table> |
</body> |
</html> |
这篇关于“DTD禁止”调用XslCompiledTransform.Transform()时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文