Displaying A Structured Document Table In HTML

How do you use structured document data stored in a table to render a block of HTML code? With a HTML render engine accessed via an API.

OIDs and Structured Document Tables

All the elements of table in a structured document will share the same base Object IDentifier or OID. In the case of the Library Budget:

All the elements (rows) of the table can be retrieved with an API call like:


Note: this is mock-up code.

Sample Rendered HTML Table Code

To render the table data for OID as HTML:


Note the .html extension in the mock-up API call.

The lockup API call returns the HTML code to generate this table:


Capital Project Funds Not Included)

BUDGET 2014-15
(As amended)
Circulation / Technical Services1977239219024318749442150390
Children's / Literacy Svcs597036716890766359727454
Adult-Teen / Information Services788053878548979442900421
Administrative Services1797872203904820468012114725

Sample Table Rendered CSV

To render the table data for OID as a CSV file:


Note the .csv extension in the mock-up API call.

The mock-up API call returns the table in CSV format:

Circulation / Technical Services,1977239,2190243,1874944,2150390
Children's / Literacy Svcs,597036,716890,766359,727454
Adult-Teen / Information Services,788053,878548,979442,900421
Administrative Services,1797872,2039048,2046801,2114725

OIDs and RFCs

Object IDentifiers or OIDs are used extensively in the Internet's Request For Comments or RFC. They were introduced to solve the problems that complex protocols have with fixed field packet format.

In a fixed field packet, each type of data has an exact sequence and size in the packet: src IP addr, dest IP addr, protocol, time to live, etc. If a packet did not need a particular field it still had to include it as null data to keep the packet format intact. As protocols became more complex the number of fields in a packet becomes large with most of the packet data being nulls because no packet uses all or even most of the fields available.

The OID was introduced to allow "run length encoding" of the data in the packet. Instead of having a fixed packet format you have a packet that is a series of OID:data pairs. An OID is a dotted number,, read left to right. Each number represents a layer in a hierarchy. An OID can either be a parent layer with child layers below it or it can be an actual piece of data with a format.

For example a shared schema for OID may define this OID as an integer or a string of text ending with a null. The sender transmitting the data walks its OID data tree to find the data's OID is and the data type is a string. The sender transmits the data as "". On the receiving side as the packet is received it walks the OID tree: 5 parent, 2 parent, 4 parent, 1 data object of type string. The next byte in the packet is the start of the string. The end of the string is indicated by a null, 0, byte. Once the null byte is found, the receiver knows the following byte starts the next OID.

OIDs create structure in data. All the rows for a particular section of a structured document will share the same base OID. Sections, headings, tables, lists, figures. A parent OID can contain entire child OIDs of different document parts. A section may have one or more headings. The headings may contain sub-headings or tables or figures. The included parts in a section will all start with the parent's OID,, and will add more layer numbers on. For example a table in a sub-heading in a section may have an OID of The "3" identifies this as the third sub-heading of the section. 6 indicates the sixth item in the sub-heading. All of the elements of this table will start with OID