永久嵌入AddnamespaceDeclaration [英] Permanently embed a AddnamespaceDeclaration

查看:252
本文介绍了永久嵌入AddnamespaceDeclaration的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将要创建Office文档的应用程序,并且我已经使用Office Open XML SDK获得了所有代码。但是,它使用了大量的语句和声明,例如



pWkb.AddNamespaceDeclaration(r,http://schemas.openxmlformats.org/officeDocument/2006/关系)





任何人都可以提供一些关于如何将这些声明永久嵌入到编译代码中的提示,以便应用程序不会调用每次开始时都要上网吗?我可以将一个组件放入app目录,以便用作参考而不是上网吗?



提前感谢您提供的任何提示

I am developing a application that is going to be creating office documents and I''ve gotten all of the code to work using Office Open XML SDK. However, it uses lots of statements and declarations such as

pWkb.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships")


Can anyone provide some hints on how to permanently embed these declarations into the compiled code so that the application does not call out to the internet every time it starts? Is there a component I can put into the app directory for it to use as reference rather than going to the internet?

Thanks in advance for any hints you can provide

推荐答案

将命名空间嵌入Xml元素的一种方法是将名称作为参数传递给XmlRoot属性,在此处解释xmlrootattribute_properties [ ^ ]

ie
one way to embed the namespace to the Xml element is pass the name as argument to the XmlRoot attribute, explained here xmlrootattribute_properties[^]
i.e
[XmlRoot(Namespace = "http://www.codeproject.com")]
public class MyClass
{
   // Insert the members of the Group class.
}


这篇关于永久嵌入AddnamespaceDeclaration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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