Пример #1
0
        public static SstDocument Parse(XmlDocument xml, XmlNamespaceManager namespaceManager)
        {

            try
            {
                SstDocument sstDoc=new SstDocument();
                sstDoc.AddNewSst();
                CT_Sst sst = sstDoc.GetSst();
                sst.count = XmlHelper.ReadInt(xml.DocumentElement.Attributes["count"]);
                sst.uniqueCount = XmlHelper.ReadInt(xml.DocumentElement.Attributes["uniqueCount"]);

                XmlNodeList nl = xml.SelectNodes("//d:sst/d:si", namespaceManager);
                if (nl != null)
                {
                    foreach (XmlNode node in nl)
                    {
                        CT_Rst rst = CT_Rst.Parse(node, namespaceManager);
                        sstDoc.sst.si.Add(rst);
                    }
                }
                return sstDoc;
            }
            catch (XmlException e)
            {
                throw new IOException(e.Message);
            }
        }        
Пример #2
0
        public static SstDocument Parse(XmlDocument xml, XmlNamespaceManager namespaceManager)
        {
            try
            {
                SstDocument sstDoc = new SstDocument();
                sstDoc.AddNewSst();
                CT_Sst sst = sstDoc.GetSst();
                sst.count       = XmlHelper.ReadInt(xml.DocumentElement.Attributes["count"]);
                sst.uniqueCount = XmlHelper.ReadInt(xml.DocumentElement.Attributes["uniqueCount"]);

                XmlNodeList nl = xml.SelectNodes("//d:sst/d:si", namespaceManager);
                if (nl != null)
                {
                    foreach (XmlNode node in nl)
                    {
                        CT_Rst rst = CT_Rst.Parse(node, namespaceManager);
                        sstDoc.sst.si.Add(rst);
                    }
                }
                return(sstDoc);
            }
            catch (XmlException e)
            {
                throw new IOException(e.Message);
            }
        }
Пример #3
0
        public static SstDocument Parse(XmlDocument xml, XmlNamespaceManager namespaceManager)
        {

            try
            {
                SstDocument sstDoc=new SstDocument();
                sstDoc.AddNewSst();

                XmlNodeList nl = xml.SelectNodes("//d:sst/d:si", namespaceManager);
                if (nl != null)
                {
                    foreach (XmlNode node in nl)
                    {
                        XmlNode n = node.SelectSingleNode("d:t", namespaceManager);
                        CT_Rst rst = new CT_Rst();
                        rst.XmlText = node.InnerXml;
                        if (n != null)
                        {
                            rst.t = n.InnerText;
                        }
                        else
                        {
                            XmlNodeList tNodes = node.SelectNodes(".//d:t", namespaceManager);
                            if (tNodes != null)
                            {
                                rst.r = new System.Collections.Generic.List<CT_RElt>();

                                foreach (XmlNode tNode in tNodes)
                                {
                                    CT_RElt relt = new CT_RElt();
                                    relt.t = tNode.InnerText;
                                    rst.r.Add(relt);
                                }
                            }
                        }
                        sstDoc.sst.si.Add(rst);
                    }
                }
                return sstDoc;
            }
            catch (XmlException e)
            {
                throw new IOException(e.Message);
            }
        }        /// <summary>
Пример #4
0
        public static SstDocument Parse(XmlDocument xml, XmlNamespaceManager namespaceManager)
        {
            try
            {
                SstDocument sstDoc = new SstDocument();
                sstDoc.AddNewSst();

                XmlNodeList nl = xml.SelectNodes("//d:sst/d:si", namespaceManager);
                if (nl != null)
                {
                    foreach (XmlNode node in nl)
                    {
                        XmlNode n   = node.SelectSingleNode("d:t", namespaceManager);
                        CT_Rst  rst = new CT_Rst();
                        rst.XmlText = node.InnerXml;
                        if (n != null)
                        {
                            rst.t = n.InnerText;
                        }
                        else
                        {
                            XmlNodeList tNodes = node.SelectNodes(".//d:t", namespaceManager);
                            if (tNodes != null)
                            {
                                rst.r = new System.Collections.Generic.List <CT_RElt>();

                                foreach (XmlNode tNode in tNodes)
                                {
                                    CT_RElt relt = new CT_RElt();
                                    relt.t = tNode.InnerText;
                                    rst.r.Add(relt);
                                }
                            }
                        }
                        sstDoc.sst.si.Add(rst);
                    }
                }
                return(sstDoc);
            }
            catch (XmlException e)
            {
                throw new IOException(e.Message);
            }
        }        /// <summary>
Пример #5
0
        public static SstDocument Parse(XmlDocument xml, XmlNamespaceManager namespaceManager)
        {

            try
            {
                SstDocument sstDoc=new SstDocument();
                sstDoc.AddNewSst();

                XmlNodeList nl = xml.SelectNodes("//d:sst/d:si", namespaceManager);
                if (nl != null)
                {
                    foreach (XmlNode node in nl)
                    {
                        CT_Rst rst = CT_Rst.Parse(node, namespaceManager);
                        sstDoc.sst.si.Add(rst);
                    }
                }
                return sstDoc;
            }
            catch (XmlException e)
            {
                throw new IOException(e.Message);
            }
        }