Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

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
C#
[XmlRoot(Namespace = "http://www.codeproject.com")]
public class MyClass
{
   // Insert the members of the Group class.
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900