public virtual void ControlsAddedAfterParseAreLinkedWithForms() { Document doc = iText.StyledXmlParser.Jsoup.Jsoup.Parse("<body />"); doc.Body().Html("<form />"); iText.StyledXmlParser.Jsoup.Nodes.Element formEl = doc.Select("form").First(); formEl.Append("<input name=foo value=bar>"); NUnit.Framework.Assert.IsTrue(formEl is FormElement); FormElement form = (FormElement)formEl; NUnit.Framework.Assert.AreEqual(1, form.Elements().Count); IList <KeyVal> data = form.FormData(); NUnit.Framework.Assert.AreEqual("foo=bar", data[0].ToString()); }