internal bool AddTextNodeOutsideTable(HtmlTextElement textNode) { if (textNode != null && Current.m_TableNode != null && Current.m_TableNode.ParentNode != null) { Current.m_TableNode.ParentNode.InsertBefore(textNode, Current.m_TableNode); // NOTE: The parser current node and stack will not change // we simply insert the text node before the table return(true); } return(false); }
private void GetTextRecursive(HtmlNode currElement, StringBuilder bld) { HtmlTextElement currTxt = currElement as HtmlTextElement; if (currTxt != null) { bld.Append(System.Web.HttpUtility.HtmlDecode(currTxt.InnerText)); bld.Append(" "); } foreach (HtmlNode node in currElement.ChildNodes) { if ( "SCRIPT".Equals(node.Name, StringComparison.InvariantCultureIgnoreCase) || "STYLE".Equals(node.Name, StringComparison.InvariantCultureIgnoreCase)) { // Skill those } else { GetTextRecursive(node, bld); } } }