Exemplo n.º 1
0
        public virtual void After()
        {
            Document doc = iText.StyledXmlParser.Jsoup.Jsoup.Parse("<p>One <b>two</b> three</p>");

            iText.StyledXmlParser.Jsoup.Nodes.Element newNode = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag
                                                                                                              .ValueOf("em"), "");
            newNode.AppendText("four");
            doc.Select("b").First().After(newNode);
            NUnit.Framework.Assert.AreEqual("<p>One <b>two</b><em>four</em> three</p>", doc.Body().Html());
            doc.Select("b").First().After("<i>five</i>");
            NUnit.Framework.Assert.AreEqual("<p>One <b>two</b><i>five</i><em>four</em> three</p>", doc.Body().Html());
        }