Exemple #1
0
        void AddNewRelationship(int res_number, string res_id, string res_type)
        {
            Dictionary <string, string> attrs = new Dictionary <string, string>();

            attrs["Id"]     = res_id;
            attrs["Type"]   = res_type;
            attrs["Target"] = "worksheets/sheet" + res_number.ToString() + ".xml";
            XmlElement relships = xml_wb_rels.FindFirstNode("Relationships", new Dictionary <string, string>());

            xml_wb_rels.CreateElement("Relationship", attrs, String.Empty, relships);
            xml_wb_rels.Document.InnerXml = xml_wb_rels.Document.InnerXml.Replace("xmlns=\"\"", String.Empty);
            xml_wb_rels.SaveDocument(temp_path + "\\xl\\_rels\\workbook.xml.rels");
        }