为了使基本 XSL-fo 标签正常工作,我需要安装 FO 处理器吗?

发布于 2024-07-29 02:13:17 字数 430 浏览 3 评论 0原文

我是 XML 新手...并且我被迫查看 XSL-FO。 我的简单问题是,使用 XSL-fo,我不会做任何 pdf 生成工作。相反,我只想检查 XSL-fo 及其基本标签。 我要在 Visual Studio 的 dotnet 环境中工作。 因此,要继续进行此操作,我是否需要一个单独的 FO 处理器,否则即使没有它也会有足够的支持。?

因为我访问的每个页面,他们都告诉我,生成 pdf 和 xsl-fo,然后安装 Fo 处理器。

我尝试过的网络中的所有示例代码,输出都是

“”” XML页面无法显示 无法使用 XSL 样式表查看 XML 输入。 请更正错误,然后单击“刷新”按钮,或稍后重试。


样式表不包含文档元素。 样式表可能是空的,或者它可能不是格式良好的 XML 文档...""

提前感谢您的回复...

I am new to XML... and i am forced to look at XSL-FO. My simple question is that using XSL-fo, i am not going to do any pdf generation work.. rather I just want to check on XSL-fo with its basic tags. I am to work in dotnet environment in Visual Studio. So to go ahead with this do i need a seperate FO Processor or there will be enough support without it.??

Because every single page which i visited, they tell, pdf generation and xsl-fo then install Fo processor.

And all the sample codes in net which i tried, the output was

"""
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML documen...""

Thanks in advance for your reply...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的憧憬 2024-08-05 02:13:17

XSL-FO 是一种 XML 语言,它描述了如何呈现分页内容,但您需要一些东西来解释它(通常是呈现 PDF 输出的 XSL-FO 引擎)。

如果您只是想要一种快速、简单的方法来查看输出的样子,您可以将 XSLT 处理指令添加到指向 RenderX 提供的 FO2HTML 样式表

<?xml-stylesheet type="text/xsl" href="fo2html.xslt" media="screen"?>

FO2HTML 样式表会将您的 XSL-FO XML 转换为等效的 HTML 输出(例如,块变为 div,内联变为 span 等)。

有些东西不能很好地转换为 HTML,例如分页(因为 HTML 文档本质上是一个巨大的页面),但它可能是一种“足够好”的快速渲染解决方案。

要真正测试您的 XSL-FO 并验证输出是否正确,您应该通过 XSL-FO 引擎(甚至几个,因为不同的供应商有不同级别的支持,有时很难判断问题是否是)来运行它。您的 XSL-FO 或渲染引擎)并检查生成的 PDF 输出。

XSL-FO is an XML language that describes how paginated content should be rendered, but you need something to interpret it(typically an XSL-FO engine that renders PDF output).

If you just want a quick and easy way to see what the output will look like, you could add an XSLT processing instruction to your XSL-FO XML documents that point to the FO2HTML stylesheet that RenderX provides.

<?xml-stylesheet type="text/xsl" href="fo2html.xslt" media="screen"?>

The FO2HTML stylesheet will convert your XSL-FO XML into the equivalent HTML output(e.g. block become div and inline become span, etc).

There are some things that will not translate well into HTML, such as pagination(since HTML documents are essentially one giant page), but it might be a "good enough" solution for quick rendering.

To really test your XSL-FO and verify that the output is correct, you should run it through an XSL-FO engine(or even a few, since different vendors have varying levels of support and it is sometimes difficult to tell if the problem is your XSL-FO or the rendering engine) and inspect the generated PDF output.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文