gpt4 book ai didi

html - 如何将带有 CSS 的 HTML 转换为 xsl-fo?

转载 作者:搜寻专家 更新时间:2023-10-31 08:19:40 24 4
gpt4 key购买 nike

我想将带有 Css 的 HTML 转换为 xsl-fo。任何人都可以向我建议如何转换它。

我有 2 个文件,一个 html 文件和一个 css 文件。我想用这两个文件生成 xsl-fo 文件,这样我就可以轻松生成 pdf、rtf 和其他格式。

HTML file 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="style.css"/> *--> css file*
<title></title>
</head>
<body>
<div class="cw-default">
<p><span class="sans"><b>Short title</b></span> this is text for testing<i>italic text</i>.</p>
<p class="center">this is test</p>
</div>
</body>
</html>

style.css 文件会将属性添加到 html 中,我希望此属性值也将出现在生成的 FO 文件中。

/* Style Sheet */

.cw-default { font-size: 1em; }
.sans { font-family: arial,helvetica }
.center {text-align: center;}

最佳答案

我们已经在很多元素中使用过它:

Werner Donne's CSS to XSL FO

这是 XSL plus 代码,用于将 CSS、CSS2 转换为 XSL FO。

关于html - 如何将带有 CSS 的 HTML 转换为 xsl-fo?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16272716/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com