c++ - 是否有免费的 C++ xsl-fo 转 PDF 引擎?

标签 c++ xml qt qt4 xsl-fo

是否有可以在QT中使用的用C++编写的xsl-fo to PDF引擎?

到目前为止,我遇到的引擎都是用 java 编写的。

最佳答案

您应该使用 QXmlQuery:link

来自 qt 文档:

Running an XSLT stylesheet is like running an XQuery, except that when you construct your QXmlQuery, you must pass QXmlQuery::XSLT20 to tell QXmlQuery to interpret whatever it gets from setQuery() as an XSLT stylesheet instead of as an XQuery. You must also set the input document by calling setFocus().

代码:

QXmlQuery query(QXmlQuery::XSLT20);
query.setFocus(QUrl("myInput.xml"));
query.setQuery(QUrl("myStylesheet.xsl"));
query.evaluateTo(out);

其中“out”是 pdf 文件。和 xsl 文件定义如何将 xml 文件转换为 pdf。

关于c++ - 是否有免费的 C++ xsl-fo 转 PDF 引擎?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5911055/

相关文章:

python - 如何在不移动 namespace 的情况下使用 Python 的 ElementTree 解析和编写 XML?

qt - QGraphicsView RubberBandDrag 留下工件

c++ - QSerialPort 读取有符号值

java - 控制代码 0x6 导致 XML 错误

xml - 在节点对象的grails中使用xpath表达式

c++ - 多类作业

c++ - 对象已经定义

c++ - 根据从 Qt 中的 XML 表单中读取的字符串更改 Widget 的名称

c++ - 使用Boost asio接收命令并执行

c++ - 替换字符会增加一个字符