Ejemplo n.º 1
0
 internal virtual void Clear()
 {
     Children.Clear();
     if (_innerText != null)
     {
         _innerText = null;
     }
 }
Ejemplo n.º 2
0
        public void GetContentFrom(XmlNode xNode)
        {
            Name = xNode.Name;
            Attributes.Clear();
            if (xNode.Attributes != null)
            {
                foreach (XmlAttribute attr in xNode.Attributes)
                {
                    Attributes.Add(attr.Name.ToLower(), attr.Value);
                }
            }

            Children.Clear();
            if (xNode.ChildNodes.Count == 0)
            {
                _innerText = new TextHolder(xNode.InnerText);
            }
            else
            {
                foreach (XmlNode child in xNode.ChildNodes)
                {
                    if (child.Name.ToLower().Equals("#text"))
                    {
                        _innerText = new TextHolder(child.InnerText);
                    }
                    else if (child.Name.ToLower().Equals("#comment"))
                    {
                        _innerText = new TextHolder("<!--" + child.InnerText + "-->");
                    }
                    else
                    {
                        HtmlNode node = new HtmlNode(child.Name);
                        Children.Add(node);
                        node.GetContentFrom(child);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 internal void SetTextHolder(TextHolder holder)
 {
     _innerText = holder;
 }