Пример #1
0
        public static string ConvertToString(IEnumerable <DomObject> objs)
        {
            var builder = new StringBuilder();

            DomNodeVisitor.VisitAll(objs, new OuterTextWriter(builder));
            return(builder.ToString());
        }
Пример #2
0
        public static string ConvertToString(DomObject obj)
        {
            var builder = new StringBuilder();

            DomNodeVisitor.Visit(obj, new OuterTextWriter(builder));
            return(builder.ToString());
        }
Пример #3
0
        public static string ConvertToString(this ITextVisitor v, IEnumerable <DomNode> nodes)
        {
            var sb = new StringBuilder();

            v.SetBuffer(sb);
            DomNodeVisitor.VisitAll(nodes, v);
            return(sb.ToString());
        }
Пример #4
0
        public static string ConvertToString(this ITextVisitor v, DomNode node)
        {
            var sb = new StringBuilder();

            v.SetBuffer(sb);
            DomNodeVisitor.Visit(node, v);
            return(sb.ToString());
        }
Пример #5
0
        public void Write(DomObject obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            DomNodeVisitor.Visit(obj, this);
        }
Пример #6
0
        private DomObjectQuery Collect(Evaluator eval, DomContainer root)
        {
            var elements = new List <DomNode>();

            DomNodeVisitor.Visit(root, node => {
                DomElement el = node as DomElement;
                if (el != null)
                {
                    if (eval.Matches(root, el))
                    {
                        elements.Add(el);
                    }
                }
            });
            return(NewObjectQuery(elements));
        }
Пример #7
0
 private void Visit(IEnumerable <DomObject> nodes)
 {
     DomNodeVisitor.VisitAll(nodes, this);
 }
Пример #8
0
 public DomNode CompressWhitespace()
 {
     DomNodeVisitor.Visit(this, t => t.MergeAdjacentText());
     DomNodeVisitor.Visit(this, t => t.TryCompressWS());
     return(this);
 }