public override bool Matches(iText.StyledXmlParser.Jsoup.Nodes.Element root, iText.StyledXmlParser.Jsoup.Nodes.Element
                              element)
 {
     if (root == element)
     {
         return(false);
     }
     iText.StyledXmlParser.Jsoup.Nodes.Element prev = element.PreviousElementSibling();
     return(prev != null && evaluator.Matches(root, prev));
 }
Beispiel #2
0
 public virtual void OrphanNodeReturnsNullForSiblingElements()
 {
     iText.StyledXmlParser.Jsoup.Nodes.Node node = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag
                                                                                                 .ValueOf("p"), "");
     iText.StyledXmlParser.Jsoup.Nodes.Element el = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag
                                                                                                  .ValueOf("p"), "");
     NUnit.Framework.Assert.AreEqual(0, node.SiblingIndex());
     NUnit.Framework.Assert.AreEqual(0, node.SiblingNodes().Count);
     NUnit.Framework.Assert.IsNull(node.PreviousSibling());
     NUnit.Framework.Assert.IsNull(node.NextSibling());
     NUnit.Framework.Assert.AreEqual(0, el.SiblingElements().Count);
     NUnit.Framework.Assert.IsNull(el.PreviousElementSibling());
     NUnit.Framework.Assert.IsNull(el.NextElementSibling());
 }