Ejemplo n.º 1
0
 public static String ToString(IXmlExchange_Multi xmlexchange_Multi)
 {
     string[] rootTags = new string[xmlexchange_Multi.XmlElementCount];
     for (int i = 0; i < rootTags.Length; i++)
     {
         rootTags[i] = "root";
     }
     return(ToString(xmlexchange_Multi, rootTags));
 }
Ejemplo n.º 2
0
        public static String ToString(IXmlExchange_Multi xmlexchange, string[] rootTags)
        {
            string[]      arr = ToStringArr(xmlexchange, rootTags);
            StringBuilder sb  = new StringBuilder();

            for (int i = 0; i < arr.Length; i++)
            {
                if (i != 0)
                {
                    sb.Append("\r\n");
                }
                sb.Append(arr[i]);
            }
            return(sb.ToString());
        }
Ejemplo n.º 3
0
        public static String[] ToStringArr(IXmlExchange_Multi xmlexchange, string[] rootTags)
        {
            int arrLen = xmlexchange.XmlElementCount;

            XmlElement[] elemArr = new XmlElement[arrLen];
            for (int i = 0; i < arrLen; i++)
            {
                XmlDocument xmlDoc   = new XmlDocument();
                XmlNode     rootNode = xmlDoc.CreateElement(rootTags[i]);
                xmlDoc.AppendChild(rootNode);
                elemArr[i] = (XmlElement)rootNode;
            }
            xmlexchange.Save(elemArr);
            string[] strArr = new string[arrLen];
            for (int i = 0; i < arrLen; i++)
            {
                XmlElement elem = elemArr[i];
                strArr[i] = ToString(elem.OwnerDocument);
            }
            return(strArr);
        }