Example #1
0
        public static IEnumerable <XmlSelectValue> zGetValues(this XmlSelect select)
        {
            int nb = select.SourceXPathValues.Length;

            while (select.Get())
            {
                string[] values = new string[nb];
                select.Values.CopyTo(values, 0);
                yield return(new XmlSelectValue {
                    Path = select.PathCurrentNode, Values = values
                });
            }
        }
Example #2
0
        public static DataTable zToDataTable_v1(this XmlSelect select)
        {
            DataTable dtResult = CreateSelectDatatable(select);

            while (select.Get())
            {
                DataRow row = dtResult.NewRow();
                //row[0] = select.TranslatedPathCurrentNode;
                row[0] = select.PathCurrentNode;
                //row[1] = select.Values[0];
                //for (int i = 1; i < select.SourceXPathValues.Length; i++)
                //    row[i + 1] = select.GetValue(i);
                int i = 1;
                foreach (string value in select.Values)
                {
                    row[i++] = value;
                }
                dtResult.Rows.Add(row);
            }
            return(dtResult);
        }