internal BuilderInfo Clone() { BuilderInfo info = new BuilderInfo(); info.Initialize(this); Debug.Assert(info.NodeType != XmlNodeType.Text || XmlCharType.Instance.IsOnlyWhitespace(info.Value)); return info; }
private void DeclareNamespace(string nspace, string prefix) { int index = NewNamespace(); Debug.Assert(_namespaceList[index] != null && _namespaceList[index] is BuilderInfo); BuilderInfo ns = (BuilderInfo)_namespaceList[index]; if (prefix == _atoms.Empty) { ns.Initialize(_atoms.Empty, _atoms.Xmlns, _atoms.XmlnsNamespace); } else { ns.Initialize(_atoms.Xmlns, prefix, _atoms.XmlnsNamespace); } ns.Depth = _recordDepth; ns.NodeType = XmlNodeType.Attribute; ns.Value = nspace; _scopeManager.PushNamespace(prefix, nspace); }
private void ResetRecord(int state) { Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); if ((state & StateMachine.BeginRecord) != 0) { _attributeCount = 0; _namespaceCount = 0; _currentInfo = _mainNode; _currentInfo.Initialize(_atoms.Empty, _atoms.Empty, _atoms.Empty); _currentInfo.NodeType = XmlNodeType.None; _currentInfo.IsEmptyTag = false; _currentInfo.htmlProps = null; _currentInfo.htmlAttrProps = null; } }
private void BeginAttribute(string prefix, string name, string nspace, object?htmlAttrProps, bool search) { int attrib = FindAttribute(name, nspace, ref prefix); if (attrib == -1) { attrib = NewAttribute(); } Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); BuilderInfo attribute = (BuilderInfo)_attributeList[attrib] !; attribute.Initialize(prefix, name, nspace); attribute.Depth = _recordDepth; attribute.NodeType = XmlNodeType.Attribute; attribute.htmlAttrProps = htmlAttrProps as HtmlAttributeProps; attribute.search = search; _currentInfo = attribute; }