private static void PopulatePropertiesDocTypeHeader(HtmlHeaderNode node, ListView listView) { InitializeListView(ParameterColumns, listView); foreach (var parm in node.Parameters) { listView.Items.Add(parm); } }
/// <summary> /// Parses an HTML DOCTYPE header tag. Assumes current position is just after tag name. /// </summary> /// <param name="parser">Parser object.</param> private HtmlHeaderNode ParseHtmlHeader(TextParser parser) { HtmlHeaderNode node = new HtmlHeaderNode(ParseAttributes(parser)); string tagEnd = ">"; parser.MoveTo(tagEnd); parser.MoveAhead(tagEnd.Length); return(node); }
private static void PopulatePropertiesDocTypeHeader(HtmlHeaderNode node, ListView listView) { InitializeListView(ParameterColumns, listView); foreach (var att in node.Attributes) { var item = listView.Items.Add(att.Key); item.SubItems.Add(att.Value != null ? att.Value.Value : "(null)"); } }
public void TestHtmlHeader() { List <Attribute>[] htmlHeaders = new List <Attribute>[] { new List <Attribute> { new Attribute("html") }, new List <Attribute> { new Attribute("HTML"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD HTML 4.01//EN\""), new Attribute("\"http://www.w3.org/TR/html4/strict.dtd\""), }, new List <Attribute> { new Attribute("html"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD HTML 4.01 Transitional//EN\""), new Attribute("\"http://www.w3.org/TR/html4/loose.dtd\""), }, new List <Attribute> { new Attribute("html"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD HTML 4.01 Frameset//EN\""), new Attribute("\"http://www.w3.org/TR/html4/frameset.dtd\""), }, new List <Attribute> { new Attribute("html"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD XHTML 1.0 Strict//EN\""), new Attribute("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\""), }, new List <Attribute> { new Attribute("html"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD XHTML 1.0 Transitional//EN\""), new Attribute("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""), }, new List <Attribute> { new Attribute("html"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD XHTML 1.0 Frameset//EN\""), new Attribute("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\""), }, new List <Attribute> { new Attribute("html"), new Attribute("PUBLIC"), new Attribute("\"-//W3C//DTD XHTML 1.1//EN\""), new Attribute("\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\""), }, }; foreach (List <Attribute> attributes in htmlHeaders) { string header = string.Format($"<!DOCTYPE {string.Join(" ", attributes)}>"); HtmlMonkeyDocument document = HtmlMonkeyDocument.FromHtml(header); Assert.AreEqual(1, document.RootNodes.Count); HtmlHeaderNode node = document.RootNodes[0] as HtmlHeaderNode; Assert.AreNotEqual(null, node); Attribute.CompareAttributes(attributes, node.Attributes); } }
private static string ShortDescriptionDocTypeHeader(HtmlHeaderNode node) => "<!doctype>";
private static string LongDescriptionDocTypeHeader(HtmlHeaderNode node) => string.Empty;