November Happy Hour will be moved to Thursday December 5th.

Class HtmlParser

Parses any html into a valid xhtml document.

Inheritance
System.Object
HtmlParser
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core.Html
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class HtmlParser
Remarks

Results either in pure text or XmlDocument

Constructors

HtmlParser(String)

Parses a string containing Html and converts it to Xhtml that can be returned as a string or a XmlDocument.

Declaration
public HtmlParser(string htmlToIndex)
Parameters
Type Name Description
System.String htmlToIndex

The Html that will be parsed.

HtmlParser(String, Boolean)

Parses a string containing Html and converts it to Xhtml that can be returned as a string or a XmlDocument.

Declaration
public HtmlParser(string htmlToIndex, bool allowScriptTags)
Parameters
Type Name Description
System.String htmlToIndex

The Html that will be parsed.

System.Boolean allowScriptTags

if set to true script tags will not be removed.

Methods

ToString()

Retrive HTML converted to XHTML as a string.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string containing XHTML

Overrides
System.Object.ToString()

ToXmlDocument()

Retrive HTML converted to XHTML as a XML document.

Declaration
public XmlDocument ToXmlDocument()
Returns
Type Description
System.Xml.XmlDocument

A XML document containing XHTML

Extension Methods