xslt 是否可以在动态生成的 xml 文件样式中嵌入 Open XML 格式?

发布于 2024-10-07 14:43:02 字数 109 浏览 0 评论 0原文

我有一个使用 Open XML SDK 动态生成的 xml 文件,它显示有关 docx 文件的一些元数据。是否可以使用 xslt 将样式表添加到使用 Open XML SDK 动态生成的 xml 文件中?

I have an xml file generated dynamically using the Open XML SDK which dispays some metadata about a docx file. Is it possible to use xslt to add style sheets to this dynamically generated xml file using the Open XML SDK?

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

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

发布评论

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

评论(1

花间憩 2024-10-14 14:43:02

Open XML 应该与 Word、Excel 或 PowerPoint 文档一起使用。其中每一个都有一个特定的样式部分,您可以在其中指定某些元素在整个文档中的外观。如果您知道 XML 在这些样式部分中的外观,那么您可以加载 style.xml 并使用 xslt 添加样式,但您不会使用 Open XML SDK 执行此操作,而是使用基本的 C# 代码来读取和转换 XML。我建议仅使用 Open XML SDK 动态添加样式,因为它可以消除必须了解 style.xml 架构的一些复杂性。

Open XML is supposed to be used with Word, Excel or PowerPoint documents. Each one of these have a specific section for styles where you specify how certain elements will look throughout the document. If you know how the XML will look in these style sections then you could load up the style.xml and use xslt to add styles, but you wouldn't do that with the Open XML SDK, but with basic C# code that would read and transform XML. I would recommend just using the Open XML SDK to add the styles dynamically since it should take away from some of the complexity of having to know the style.xml schema.

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