#3. The tagset is independent of the style template. If you don't specify a style then the tagset will use the default style if necessary. CSV won't find it necessary, but HTML will.
#4. The style doesn't need to know about the destination. Only the tagset needs to know. The style supplies values to style variables to which the tagset may refer. For example, the BACKGROUND variable has the background color specified by the style.
To add .02 on #4. How you actually specify a style is with the STYLE= option. For example to build on Tim's comment:
ODS HTML file='will_use_style.html' style=sasweb;
ODS CSV file='will_NOT_use_style.csv' style=sasweb;
Both of those may appear to work, however, the HTML tagset template was coded to -know- and -use- style elements to build the output file. But the CSV tagset template was coded to -not use- style elements to build the output file. So, just because I specified a style on the ODS CSV invocation, the style specification is irrelevant and unnecessary because ODS CSV or more accurately, the tagset template that is used to create the ODS CSV output file does not use the style template.
You are correct, in your last statement that TAGSETS.EXCELXP and TAGSETS.RTF or HTML all will use different "control codes" or markup tags to specify "bold" versus "red" and how to start a table and how to start a table row. Let's take the SAS title statement for example. You code this:
ods listing close;
ods html file='whattitle.html' style=sasweb;
ods tagsets.rtf file='whattitle.rtf' style=sasweb;
in the HTML file, you will see this markup:
<td class="c SystemTitle" style=" font-weight: bold; color: #FF0000;">Wombat</td>
versus this in the RTF file (if you look at it with Notepad):
So that single TITLE statement from the SAS program got handled as appropriate for each destination. To look at the underlying markup tags or control string information, I opened each output file in Notepad.
You get the different markup because the person who coded the tagset template coded the SystemTitle event to write different markup control strings or tags for each destination. It was probably someone how knew HTML really, really well, who coded the HTML tagset and someone who knew RTF really, really well who coded the RTF tagset. What they needed to know was that the SAS title would be contained in the event variable information for the SystemTitle event. In other words, the information that SAS "sends" to the tagset template controlled destination (or Markup destination) does not change. How each destination HANDLES the event information is what will change.
For a longer discussion of EVENTS and EVENT handling in Tagset Templates, consult the documentation or previous papers on ODS MARKUP and TAGSET Templates.
(OK, I guess that was more .05 than .02 worth of adding on...sorry if that's too much information.)
It's the responsibility of the tagset to convert the style attribute values such as "red" to their equivalent markup representation. That is, the RTF tagset must be able to convert "red" to "\cf6", or whatever is appropriate. HTML is fortunate since color="red" is already a perfectly acceptable attribute.
I see FOREGROUND being used in the cascading_stylesheet tagset, which is an ancestor of the HTML4 tagset. It's lowercased, though, so search for "foreground".