void test1()
	{
		try
		{
			Reader in = new StringReader(
				"<p><UL><LI>    left	terms and list operators (leftward)</LI>\n"+
				"<LI>    left	-></LI>\n"+
				"<LI>    nonassoc	++ --</LI>\n"+
				"<LI>    right	**</LI>\n"+
				"<LI>    right	! ~ \\ and unary + and -</LI>\n"+
				"<LI>    left	=~ !~ </LI>\n"+
				"<LI>    left	* / % x</LI>\n"+
				"<LI>    left	+ - .</LI>\n"+
				"<LI>    left	<< >></LI>\n"+
				"<LI>    nonassoc	named unary operators</LI>\n"+
				"<LI>    nonassoc	< > <= >= lt gt le ge</LI>\n"+
				"<LI>    nonassoc	== != <=> eq ne cmp</LI>\n"+
				"<LI>    left	&</LI>\n"+
				"<LI>    left	| ^</LI>\n"+
				"<LI>    left	&&</LI>\n"+
				"<LI>    left	||</LI>\n"+
				"<LI>    nonassoc	..</LI>\n"+
				"<LI>    right	?:</LI>\n"+
				"<LI>    right	= += -= *= etc.</LI>\n"+
				"<LI>    left	, =></LI>\n"+
				"<LI>    nonassoc	list operators (rightward)</LI>\n"+
				"<LI>    left	not</LI>\n"+
				"<LI>    left	and</LI>\n"+
				"<LI>    left	or xor</LI>\n"+
				"</UL>\n"+
				"<a href=\"/cgi-bin/query?opt&\">"+
				""
				);

			HtmlStreamTokenizer tok = new HtmlStreamTokenizer(in);
			HtmlTag tag = new HtmlTag();
			while (tok.nextToken() != HtmlStreamTokenizer.TT_EOF)
			{
				StringBuffer buf = tok.getWhiteSpace();
				if (buf.length() > 0)
					System.out.print(buf.toString());

				if (tok.getTokenType() == HtmlStreamTokenizer.TT_TAG)
				{
					try
					{
						tok.parseTag(tok.getStringValue(), tag);
						if (tag.getTagType() == HtmlTag.T_UNKNOWN)
							throw new HtmlException("unkown tag");
						System.out.print(tag.toString());
					}
					catch (HtmlException e)
					{
						// invalid tag, spit it out
						System.out.print("<" + tok.getStringValue() + ">");
					}
				}
				else
				{
					buf = tok.getStringValue();
					if (buf.length() > 0)
						System.out.print(buf.toString());
				}
			}

			// hang out for a while
			System.in.read();
		}
		catch (Exception e)
		{
			System.out.println(e.getMessage());
		}
	}