public void _005_FunctionColumn() { XPathDataColumn c = new XPathDataColumn("asdf[1]/text()"); c.Function = "SDfS"; template.Columns.Add(c); AssertSerialization(); }
public void AddXPathColumnToPosition(int rowIndex, int columnIndex, string xpath) { if (columnIndex < 0 || rowIndex < 0) return; List<XPathDataColumn> xColumns = this.XColumns; bool insert = true; string rowPath = xpath; for (int i = 0; i < xColumns.Count; i++) { string absPath = XPathInfo.Combine(RowRule.RowsXPath, xColumns[i].RelativeXPath); if (columnIndex == GetIndex(xColumns[i])) { insert = false; rowPath = XPathInfo.CommonPart(rowPath, XPathInfo.RowCommonPart(absPath, xpath)); } else rowPath = XPathInfo.CommonPart(rowPath, absPath); } for (int i = 0; i < xColumns.Count; i++) xColumns[i].RelativeXPath = XPathInfo.Relative(XPathInfo.Combine(RowRule.RowsXPath, xColumns[i].RelativeXPath), rowPath); if (RowRule == null) Rules.Add(new XPathDataRowRule()); RowRule.RowsXPath = rowPath; if (insert) { XPathDataColumn col = new XPathDataColumn(); col.RelativeXPath = XPathInfo.Relative(xpath, rowPath); this.Columns.Insert(Math.Min(columnIndex, this.Columns.Count), col); } }