// current doc we are building into // the stack of open elements // current base uri, for creating new elements // currentToken is used only for error tracking. // null when not tracking errors internal virtual void InitialiseParse(string input, string baseUri, ParseErrorList errors) { Validate.NotNull(input, "String input must not be null"); Validate.NotNull(baseUri, "BaseURI must not be null"); doc = new Document(baseUri); reader = new CharacterReader(input); this.errors = errors; tokeniser = new Tokeniser(reader, errors); stack = new DescendableLinkedList<Element>(); this.baseUri = baseUri; }
// current doc we are building into // the stack of open elements // current base uri, for creating new elements // currentToken is used only for error tracking. // null when not tracking errors internal virtual void InitialiseParse(string input, string baseUri, ParseErrorList errors) { Validate.NotNull(input, "String input must not be null"); Validate.NotNull(baseUri, "BaseURI must not be null"); doc = new Document(baseUri); reader = new CharacterReader(input); this.errors = errors; tokeniser = new Tokeniser(reader, errors); stack = new DescendableLinkedList <Element>(); this.baseUri = baseUri; }
/// <summary> /// Utility method to unescape HTML entities from a string /// </summary> /// <param name="string">HTML escaped string</param> /// <param name="inAttribute">if the string is to be escaped in strict mode (as attributes are)</param> /// <returns>an unescaped string</returns> public static string UnescapeEntities(string @string, bool inAttribute) { Tokeniser tokeniser = new Tokeniser(new CharacterReader(@string), ParseErrorList.NoTracking()); return tokeniser.UnescapeEntities(inAttribute); }
/// <summary> /// Utility method to unescape HTML entities from a string /// </summary> /// <param name="string">HTML escaped string</param> /// <param name="inAttribute">if the string is to be escaped in strict mode (as attributes are)</param> /// <returns>an unescaped string</returns> public static string UnescapeEntities(string @string, bool inAttribute) { Tokeniser tokeniser = new Tokeniser(new CharacterReader(@string), ParseErrorList.NoTracking()); return(tokeniser.UnescapeEntities(inAttribute)); }