private static DocumentRow ExtractHeaderInformation(XmlNode childNode, Document document)
        {
            var docRow = new DocumentRow(document);

            foreach (XmlNode xmlNode in childNode.ChildNodes)
            {
                if (xmlNode.Attributes != null && xmlNode.Attributes.Count > 0)
                {
                    var nameAttrib = xmlNode.Attributes.GetNamedItem("NAME");
                    if (nameAttrib.IsNull())
                    {
                        nameAttrib = xmlNode.Attributes.GetNamedItem("name");
                    }
                    if (nameAttrib.IsNull())
                    {
                        nameAttrib = xmlNode.Attributes.GetNamedItem("Name");
                    }
                    if (nameAttrib != null)
                    {
                        docRow.Add(nameAttrib.InnerText);
                    }
                    else
                    {
                        docRow.Add(GetNameFromNode(xmlNode));
                    }
                }
                else
                {
                    docRow.Add(GetNameFromNode(xmlNode));
                }
            }
            return(docRow);
        }
        private static DocumentRow GetRow(XmlNode childNode, Document document)
        {
            var docRow = new DocumentRow(document);

            foreach (XmlNode xmlNode in childNode.ChildNodes)
            {
                docRow.Add(xmlNode.InnerText);
            }
            return(docRow);
        }
        private static DocumentRow ParseRow(IExcelDataReader reader, Document parent)
        {
            var docRow = new DocumentRow(parent);

            for (var i = 0; i < reader.FieldCount; i++)
            {
                docRow.Add(reader.GetString(i));
            }
            return(docRow);
        }
Exemple #4
0
        protected DocumentRow ParseRow(string row, Document document)
        {
            var documentRow = new DocumentRow(document);

            string[] rowContent;
            if (ConfigurationManagerHelper.GetValueOnKey("stardust.useRegexParsing") == "true")
            {
                var regex   = @",(?=(?:[^\""]*\""[^\""]*\"")*(?![^\""]*\""))";
                var myRegex = new Regex(regex, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace);
                rowContent = myRegex.Split(row);
            }
            else
            {
                rowContent = row.Replace("\r", "").Split(Delimiter.ToCharArray());
            }
            foreach (var collumn in GetCells(rowContent))
            {
                AddColumn(documentRow, collumn);
            }
            return(documentRow);
        }
Exemple #5
0
 protected static void AddColumn(DocumentRow documentRow, string collumn)
 {
     documentRow.Add(collumn);
 }
Exemple #6
0
 protected void SetHeader(Document doc, DocumentRow row)
 {
     doc.SetHeaders(row);
 }
Exemple #7
0
 protected void AddRow(Document doc, DocumentRow row)
 {
     doc.Add(row);
 }