/// <summary>
        /// Renvoie la liste des informations de parametres sortants des services externes
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="nsmgr"></param>
        /// <returns></returns>
        public static List <List <ParametreEntrant> > GetParametresEntrantsServiceExterne(XmlDocument doc, XmlNamespaceManager nsmgr)
        {
            XmlNodeList                     nodeList2;
            XmlElement                      root = doc.DocumentElement;
            List <List <string> >           ListeServicesExternes = new List <List <string> >();
            List <List <ParametreEntrant> > ListeParametresEntrantsServicesExternes = new List <List <ParametreEntrant> >();
            var x = 0;

            for (int i = 2; i < ServiceExterne.NombreServicesExternes(doc, nsmgr) + 2; i++)
            {
                for (int cmp = 0; cmp < MethodeServiceExterne.NombreMethodesServicesExternes(doc, nsmgr)[i - 2]; cmp++)
                {
                    ListeServicesExternes.Add(new List <string>());
                    string xpath = @"// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][7] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][" + i + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][" + (cmp + 1) + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][2] / following-sibling::w:tbl/w:tr/w:tc  [count(. | // w:p [ w:pPr / w:pStyle [@w:val='Heading1']][7] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][" + i + "]  /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][" + (cmp + 1) + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][3] / preceding-sibling::w:tbl/w:tr/w:tc)= count(// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][7] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][" + i + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][" + (cmp + 1) + "]  /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][3] / preceding-sibling::w:tbl/w:tr/w:tc)]";


                    nodeList2 = root.SelectNodes(xpath, nsmgr);


                    foreach (XmlNode isbn2 in nodeList2)
                    {
                        ListeServicesExternes[x].Add(isbn2.InnerText);
                    }
                    ListeParametresEntrantsServicesExternes.Add(ListeAParametresEntrants(ListeServicesExternes[x]));
                    x++;
                }
            }

            return(ListeParametresEntrantsServicesExternes);
        }
        /// <summary>
        /// Fonction qui retourne la listes des objets de presentation
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="nsmgr"></param>
        /// <returns></returns>
        public static ServiceExterne ServicesExternes(XmlDocument doc, XmlNamespaceManager nsmgr)
        {
            List <MethodeServiceExterne> methodes = MethodeServiceExterne.MethodesServicesExternes(doc, nsmgr);

            return(new ServiceExterne(methodes));
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            XmlDocument doc = new XmlDocument();

            //doc.Load("C:\\Users\\CameleaOUARKOUB\\Pictures\\Exemple2.xml");
            doc.Load("C:\\Users\\CameleaOUARKOUB\\Desktop\\document.xml");



            //Create an XmlNamespaceManager for resolving namespaces.
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);

            nsmgr.AddNamespace("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            nsmgr.AddNamespace("cx", "http://schemas.microsoft.com/office/drawing/2014/chartex");
            nsmgr.AddNamespace("cx1", "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex");
            nsmgr.AddNamespace("cx2", "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex");
            nsmgr.AddNamespace("cx3", "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex");
            nsmgr.AddNamespace("cx4", "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex");
            nsmgr.AddNamespace("cx5", "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex");
            nsmgr.AddNamespace("cx6", "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex");
            nsmgr.AddNamespace("cx7", "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex");
            nsmgr.AddNamespace("cx8", "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex");
            nsmgr.AddNamespace("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            nsmgr.AddNamespace("aink", "http://schemas.microsoft.com/office/drawing/2016/ink");
            nsmgr.AddNamespace("am3d", "http://schemas.microsoft.com/office/drawing/2017/model3d");
            nsmgr.AddNamespace("o", "urn:schemas-microsoft-com:office:office");
            nsmgr.AddNamespace("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            nsmgr.AddNamespace("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            nsmgr.AddNamespace("v", "urn:schemas-microsoft-com:vml");
            nsmgr.AddNamespace("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            nsmgr.AddNamespace("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            nsmgr.AddNamespace("w10", "urn:schemas-microsoft-com:office:word");
            nsmgr.AddNamespace("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            nsmgr.AddNamespace("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            nsmgr.AddNamespace("w15", "http://schemas.microsoft.com/office/word/2012/wordml");
            nsmgr.AddNamespace("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex");
            nsmgr.AddNamespace("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            nsmgr.AddNamespace("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            nsmgr.AddNamespace("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            nsmgr.AddNamespace("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
            nsmgr.AddNamespace("mc: Ignorable", "w14 w15 w16se wp14");

            //var sequences = ConstructeurInitialisation.GetDescriptionContrainteInitialisation(doc, nsmgr);
            //List<string> resultat = sequences;
            //foreach (string y in resultat)
            //{

            //	Console.WriteLine(y.ToString());

            //}


            var sequences = MethodeServiceExterne.MethodesServicesExternes(doc, nsmgr);
            List <List <MethodeServiceExterne> > resultat = sequences;

            foreach (List <MethodeServiceExterne> y in resultat)
            {
                Console.WriteLine("nouvelle liste ");
                foreach (MethodeServiceExterne x in y)
                {
                    Console.WriteLine("nouvelle methode ");
                    Console.WriteLine(x.ToString());
                }
            }



            //	Console.ReadKey();
            //}


            //ListeTable t = new ListeTable();
            //t.NomTable(doc, nsmgr);


            //var cls = Classe.GetClasses(doc, nsmgr);
            //List<Classe> resultat = cls;
            //foreach (Classe elem in resultat)
            //{
            //	Console.WriteLine(elem.Nom);
            //	Console.ReadKey();
            //}

            //List<String> colonnes = new List<string>();
            //colonnes.Add("Nom");
            //colonnes.Add("Type");
            //colonnes.Add("Description");
            //colonnes.Add("Cle");
            //colonnes.Add("Number(18)");
            //colonnes.Add("Clé technique de lassociation entre la ligne et le kitBox.");
            //colonnes.Add("CleLigne");
            //colonnes.Add("Number(18)");
            //colonnes.Add("Clé unique de la ligne.");
            //Console.WriteLine(colonnes.Count);

            //var col = Colonne.ListeAColonnes(colonnes);
            //foreach (Colonne elem in col)
            //{
            //	Console.WriteLine(elem.ToString());
            //}

            //Console.ReadKey();

            //var col2 = Table.Tables(doc, nsmgr);
            //foreach (Table l in col2)

            //	{
            //	foreach (Donnee cl in l.Donnees)
            //	{

            //		Console.WriteLine(cl.ToString());
            //	}

            //	}


            //}
            //Console.ReadKey();


            Console.ReadKey();
        }