# Presentation: 421245

## XML for Web AccessibilityBureau of Labor Statistics

- Stephen Ferg
- ferg_s (at) bls.gov
- www.ferg.org/papers
- FedStats 508 Accessibility Workshop
- June 2002

## LabStat  Division of Data Dissemination Services

- Labstat is responsible for electronic publications of the Bureau of Labor Statistics **http://stats.bls.gov**
- Many different kinds of content are supplied to Labstat by many different program offices
- Our primary 508 concern is _**HTML data tables**_ containing statistical data.

## What we have now...

-  Workers (CPI-W)
-                                    Seasonally adjusted                Un-
-                                                           Compound  adjusted
-      Expenditure        Changes from preceding month    annual rate  12-mos.
-       Category                    2001             2002 3-mos. ended  ended
-                      July Aug. Sep. Oct. Nov. Dec. Jan.   Jan.'02   Jan.'02
-  All Items           -.3    .0   .5  -.4  -.1  -.2   .2   -0.5       0.9
-   Food and beverages  .3    .2   .2   .4  -.1   .0   .3    1.1       2.9
-   Housing             .0    .2   .0  -.1   .3   .2   .2    2.6       1.9
-   Apparel            -.5   -.5   .2   .3  -.4  -.7 -1.0   -8.0      -3.6
-   Transportation    -2.6   -.4  1.9 -2.4 -1.8  -.9   .2   -9.4      -4.2
-   Medical care        .2    .5   .4   .4   .4   .3   .5    4.9       4.6
-   Recreation          .2    .1   .2   .1   .1  -.1   .3    1.2       1.2
-   Education and
-      communication    .5    .4   .0   .6   .0   .1   .4    1.9       3.0
-   Other goods and
-      services         2.0  -1.3  1.9 -1.0  1.7 -1.3   .2    2.2       4.4
-  Special indexes:
-   Energy             -6.5  -1.7  3.6 -6.8 -5.3 -3.0  1.0  -26.2     -16.2
-   Food                 .3    .2   .1   .4   .0  -.1   .3    1.2       2.9
-   All items less
-      food and energy   .3    .1   .3   .2   .4   .1   .1    2.2       2.4

**BLS News Releases**
**... ****tables are preformatted ASCII text **

**What we have now...**

## What we would like to have ...

**What we would like to have ...**

## What we would like ...

- Program offices provide tabular data in _*a*_ _*more structured format, not plain ASCII text*_.  This will enable Labstat to translate the data into accessible Web pages
- The data is free of presentation details,  so it can be translated into a variety of presentation formats: HTML, ASCII, PDF.

## The answer ...

**XML**
*... **of course!*

## The Plan

**Files in XML format**

## A TableLayout File

## A TableData File

**<Table Identifying Info>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**

## Table = a layout with data plugged into the proper places

**<Table Identifying Info>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**
**<LabstatId><ReferencePeriod><NumericValue>**

## In TableLayout file:headers and stubs 

- Specified in a set of categories arranged in a tree structure, not by rows and columns
- Each **<Category>** element contains:
-  **<CategoryText>**** **elements
- possibly **<Subcategories>**** **element

- In TableLayout file:headers and stubs

## Reference Period ... the date for the statistic

- RpYear (e.g. “1999”)
- RpType
- M - monthly
- Q - quarterly
- S - semi-annual
- A - annual
- RpNum (range = 1..12)

- Note –
- No daily or weekly publications

## Reference periods may be specified using RpOffset attrib

- An offset from a “base” reference period supplied in the TableData file.

**<Cells>**
**<Cell LabstatId=“cuabc” RpOffset=“0”>...**
**<Cell LabstatId=“cuabc” RpOffset=“-1”>...**
**<Cell LabstatId=“cuabc” RpOffset=“-3”>...**
**</Cells>**

## Reference Periods can be translated to text: RpText tags

**<HeadCategoryText>**
**    ****<RpText get="monthname" RpOffset="-3"/>, **
**    ****<RpText get="year" RpOffset="-3"/>**
**</HeadCategoryText>**

- For a base reference period of
- 2002-M-3 (March, 2002), the text is:
**	****	****December, 2001**

## Defining the TableLayout (once)

## Adding the TableData (periodically)

## Feed the process this  . . .

- <?xml version="1.0"?>
- <!--
- =======================================================================
- DESCRIPTION.: Monthly data for (tablename), February 2001
- FILENAME....: aadat1.xml
- FILE_CREATED: 2001-11-26
- COMMENTS....: a dummy file for prototyping
- =======================================================================
- -->
- <TableData>
-   <!-- ============== document identifiers ============== -->
-   <TableIdentifiers>
-     <SurveyId>CPI</SurveyId>
-     <DocumentId>1</DocumentId>
-     <RpYear>2001</RpYear>
-     <RpType>M</RpType>
-     <RpNum>02</RpNum>
-     <ReleaseDate>2001-06-01</ReleaseDate>
-   </TableIdentifiers>
-   <!-- =============== statistics ======================= -->
-   <Statistics>
-     <Statistic LabstatId="LS--4"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>6.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--5"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>59</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--6"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>0.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--4"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>6.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--5"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>59</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--6"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>0.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--4"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>6.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--5"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>59</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--6"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>0.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--4"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>6.9</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--5"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>59</StatisticValue></Statistic>
-     <Statistic LabstatId="LS--6"     RpYear="2001" RpType="M" RpNum="2"><StatisticValue>0.9</StatisticValue></Statistic>
**and get this . . .**

## Slide 18

## Accessible HTML tables

- At this point, we can generate HTML tables from XML input.
- Now....
- What kind of HTML do we need to generate in order to be 508-compliant?

## Validation Model 1: Validate against a screen reader

## Validation Model 2:Validate against a specification

## How should we code our HTML tables?

- TD and TH? ID and HEADERS?
- SCOPE="COL/ROW/COLGROUP/ROWGROUP"?
- THEAD, TBODY, TFOOT?
- AXIS? How to handle footnotes?
- _[http://www.ferg.org/papers](http://www.ferg.org/papers)__ will have a paper  "Accessible HTML" on our research_

## Project Status

- Begun May 2001
- Finished Pilot #1 in May 2002
- Still in prototype stage – results are positive, but success is not assured.
- PDF generation may be difficult.

## Early Results

- Changes to basic Table Layouts appears to be infrequent, but we may need to support frequent changes to footnotes.
- Discovered multiple types of tables that we will need to support
- Need to build tool to assist users in creating XML TableLayout files

## XML for Web AccessibilityBureau of Labor Statistics

- Stephen Ferg
- ferg_s (at) bls.gov
- www.ferg.org / papers
**THE END**