可以xslt嵌入开放的xml库生成xml文件(带样式表) [英] can xslt be embedded with open xml library in generating xml file(with stylesheet)

查看:99
本文介绍了可以xslt嵌入开放的xml库生成xml文件(带样式表)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用open xml库(用C#编写)生成的xml文件,它会显示一些关于docx文件的元数据。所以我想知道我是否可以使用xslt使用open xml库将样式表添加到此xml文件中。

i have an xml file generated using the open xml library (written in C#) which dispays some metadata about a docx file. so i was wondering if i can use xslt to add style sheets to this xml file using the open xml library.

 

任何想法/资源/样本代码将不胜感激。

any ideas/resources/sample codes would be appreciated.

推荐答案

Hello stazera,

Hello stazera,

 

您绝对可以使用现有的.xlst样式将样式表添加到Word .docx文件中。 首先,以下是一些解决您问题的内容链接:

You definitely cans add style sheets to a Word .docx file using existing .xlst styles.  First, here are some links to content that addresses your question:

将样式表与XML文档关联1.0(第二版)

http://www.w3.org/TR/xml-stylesheet/

Associating Style Sheets with XML documents 1.0 (Second Edition)
http://www.w3.org/TR/xml-stylesheet/

Open XML Developer中心

http://msdn.microsoft.com/en-us/office /bb265236.aspx

Open XML Developer Center
http://msdn.microsoft.com/en-us/office/bb265236.aspx

Office简介(2007)Open XML文件格式

http://msdn.microsoft.com/en-us/library/aa338205.aspx

Introducing the Office (2007) Open XML File Formats
http://msdn.microsoft.com/en-us/library/aa338205.aspx

关于第三个网站,Microsoft Word 2007或2010 .docx是一个"包"。 xml。 ref和二进制文件。制作一个简单的Word文档,并使用一个独特的名称将其保存为桌面上的.docx文件。然后将其扩展名从.docx更改为
.zip。解压缩,你会看到它的组件。其中之一是"Word"。 group,组中的第一个文件是'document.xml'如果在那里指定.xslt文件,并将其包含在文档中,则需要查看._rels组,.rel文件以查看
当您将文档重新打包到 时,如何创建对.xslt的引用.zip ahd将扩展名重新更改回.docx,打包器将知道在包中包含.xslt。

With regards to the third web site, A Microsoft Word 2007 or 2010 .docx is a "package" of xml. ref and binary files. Make a simple Word doc ument, and save it with a distinctive name as a .docx file on your desktop. Then change its extension from .docx to .zip. Unzip that and you'll see its components. One of them is the "Word" group, the first file in the group is 'document.xml' If you specify the .xslt file there, and include it in the document you'll need to look at the ._rels group, the .rel file to see how to create reference to the .xslt so tat when you repackage the document into  .zip ahd rechange the extension back to .docx the packager will know to include the .xslt in the package.


这篇关于可以xslt嵌入开放的xml库生成xml文件(带样式表)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆