示例#1
0
 // 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;
 }
示例#2
0
 // 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;
 }
示例#3
0
文件: Parser.cs 项目: bkzhn/dcsoup
 /// <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);
 }
示例#4
0
文件: Parser.cs 项目: wushian/dcsoup
        /// <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));
        }