Пример #1
0
        public DefaultDomWriter(TextWriter writer, DomWriterSettings settings) : base(settings)
        {
            _writer = writer;

            _spaceAroundAttributeEqual = WriterSettings.Indent ? " " : "";
            _quoteChar = WriterSettings.QuoteAttributesCharacter.ToChar();
            _state     = new DomWriterStateMachine();
        }
Пример #2
0
        public DomNodeWriter(DomNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }

            _current = node;
            _state   = new DomWriterStateMachine();

            if (node.NodeType == DomNodeType.Element)
            {
                _state.Transition(DomWriteState.Element);
            }
        }