<? The XML version="1.0" encoding="utf-8"?>
2. Add a node and the properties, the following is a part of the code:
Xmldoc. Load (reader);
Reader. The Close ();
NamespaceManager=new XmlNamespaceManager (xmldoc NameTable);//a namespace of the XML file to this a few words!
NamespaceManager. AddNamespace (" A ", "http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition");//the default namespaces also went to add
NamespaceManager. AddNamespace (" rd ", "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner");
RootXE=xmldoc. DocumentElement;//DocumentElement access to the root of the XML document object XmlElement.
Private void invoke the (string nodename, string location, string value)
{
XmlNode ItemND=rootXE. SelectSingleNode ("/A Report/A: ReportSections/A: ReportSection/A: Body/A: ReportItems ", namespaceManager);//selectSingleNode, according to an XPath expression to get qualified first node.
The switch (nodename. Substring (0, 2))//txbJP01, JP01, Rectangle1, Line4
{
Case "tx" :
break;
Case "JP" :
break;
Case "Re" :
break;
A case of "Li" :
XmlElement xeLine=xmldoc. The CreateElement method (" Line ");//create the Line node
XmlAttribute xmlAttuName=xmldoc. CreateAttribute (" Name ");//create a properties
XmlAttuName. The InnerText=nodename;//attribute values, Line10 start
XeLine. SetAttributeNode (xmlAttuName);
3. After the program is running, in the Name attribute automatically add the XMLNS="", how to make the program does not increase the namespace?
</style>
<style>
<style> Solid</style>
</style>
<style/& gt;