The SAS Output Delivery System and reporting techniques

ods markup xhtml and id for element th and td

Reply
Contributor
Posts: 58

ods markup xhtml and id for element th and td

Hi to all,
I've started to use the XHTML template described and provided here:
http://support.sas.com/rnd/base/ods/odsmarkup/xhtml.txt
and with a bit of customization I've already rendered the pages I generate XHTML strict compliant.
However, I'm looking forward something more difficult, which I need: I've to generate tables (so from proc tabulate to the xhtml through ods) that must be readable also through a screen reader.
What is suggested is that the elements of a complex table should have an id and a the td he correspondent header attribute...so it's always possible to associate which element to which column.
Is that feasible? Any idea at all?
Thanks

Daniele
SAS Super FREQ
Posts: 8,744

Re: ods markup xhtml and id for element th and td

Hi, Daniele:
So does that mean you want to have this:<th id="xxx">Hdr1</th>
generated by your XHTML tagset instead of a simple: <th>Hdr1</th> ???

One way to insert an ID= string into your Markup Language output tags is to use the HTMLID= style attribute. However, the tagset that you're modifying or creating must have a DEFINE EVENT block for putting the HTMLID= value in the output file.

For example, the HTML3 destination automatically puts the HTMLID value into the HTML output file as an ID= option in order to link the ID= value to a style attribute or a Javascript action. (see the output from the code below. Note that you must view the HTML source in Notepad to see the ID= value.)

So if you were going to generate a custom tagset to get ID= into your output, you might look at the way PROC TABULATE syntax and PROC PRINT syntax inserts the HTMLID= value into this form of HTML output. Perhaps this will give you a way to decide how you're going to further change the event in your custom tagset template to get the ID= option that you want into your output file.

If you are planning to use JavaScript with your eventual XHTML output file, you might find this topic of interest:
http://support.sas.com/rnd/base/ods/templateFAQ/jscript.html (please note that this topic is discussing the insertion of JavaScript via the use of a STYLE template and not a TAGSET template.)

For more help and some examples of modifying a TAGSET template, refer to this site:
http://support.sas.com/documentation/cdl/en/odsug/59523/HTML/default/a002565723.htm

If you are dealing with Regulation 508 accessibility requirements, then this site might be helpful:
http://support.sas.com/kb/24/312.html

cynthia

[pre]
*** the code to test;
*** although this doesn't show ID= with XHTML, it does;
*** show how you specify HTMLID= and where each syntax change affects;
*** the HTML file. By examining this default HTML output you will get;
*** some idea of how/where you need to make changes in your XHTML;
*** tagset template to surface HTMLID= in your XHTML output file.;

ods html3 file='testid_ht3.html' style=sasweb;
proc tabulate data=sashelp.class
style={htmlid="ethel"};
title 'tabulate title';
class age / style={htmlid="xxx"};
classlev age /style={htmlid="ricky"};
var height / style={htmlid="yyy"};
table age all,
height*(mean n*f=3.)
/ style={htmlid="lucy"};
run;

proc print data=sashelp.class
style(table)={htmlid="lucy"}
style(obsheader)={htmlid="oh"}
style(obs)={htmlid="xxx"}
style(header)={htmlid="yyy"}
style(data)={htmlid="fred"};
title 'print title';
var name ;
var age height/
style(header)={htmlid="ricky"}
style(data)={htmlid="ethel"};
run;
ods _all_ close;

[/pre]
SAS Employee
Posts: 6

Re: ods markup xhtml and id for element th and td

Daniele,
Did this answer what you were seeking? With Jen Harper, I did a paper and presentation at WUSS 2006 that may interest you:Information for All: Why and How to Make Accessible SAS Output -
http://www.sascommunity.org/wiki/Information_for_All:_Why_and_How_to_Make_Accessible_SAS_Output

I'd like to compare notes, if possible.

Lisa
Ask a Question
Discussion stats
  • 2 replies
  • 173 views
  • 0 likes
  • 3 in conversation