1. what really confuses me is the apply-templaets code. what does it do? I googled and got an example to exclude certain element, but still not clear. what does that mean? doesn't the processor ignore document's elements that doesn't match select criteria?
This is described in the section 5.4 applying template rules of the recommendation.
http://www.w3.org/TR/xslt#section-Applying-Template-Rules
2. the template match="title" part is also confusing. the first template match="/" already output the title, so why do the same thing twice? the second "template match="title"" doesn't put <h1> tag anyway.
Output the title or output the title tag's text via an xpath expression is one thing, a template intended to match title tag, which is sitting there awaiting its big time, is another. They are two separate concepts. Since xpath is by-design capable of reaching anywhere from anywhere in the document, an output of title's text value can theoretically appear anywhere as you like it.