public HElement(HName name, params object[] content) { this.Name = name; var attributes = new List <HAttribute>(); var nodes = new List <HObject>(); foreach (var node in HObject.HObjects(content)) { if (node is HAttribute) { attributes.Add(node as HAttribute); } else { nodes.Add(node); } } this.Attributes = attributes.ToArray(); this.Nodes = nodes.ToArray(); }
public static HElement Element(this HBuilder h, HName name, params object[] content) { return(new HElement(name, content)); }
public static HAttribute Attribute(this HBuilder h, HName name, object value) { return(new HAttribute(name, value)); }
public HAttribute(HName name, object value) { this.Name = name; this.Value = value; }
public HElement Element(HName name) { return(Elements(name).FirstOrDefault()); }
public IEnumerable <HElement> Elements(HName name) { return(Elements().Where(element => element.Name.LocalName == name.LocalName && element.Name.Namespace == name.Namespace)); }