Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 2.82 KB

docTableParserForWET3.x.mediawiki

File metadata and controls

68 lines (45 loc) · 2.82 KB

Table of Contents

Table Parser for WET 3.0

français

Overview

Project Lead: Pierre Dubois (@duboisp) - Industry Canada, Canadian Intellectual Property Office

Purpose

Create a plugin that use a table

Developing for WET with the table parser

How to parse the table

  1. Load the dependency "parserTable"
  2. call the parser with your jQuery table element
if (!$(elem).data().tblparser) { _pe.fn.parsertable.parse($(elem)); }

How to Access to the parsed data

That is simple, once the table are fully parsed, each tabular element get a new jQuery.Data attribute called "tblparser". You can access it like this

tblparser = $(elem).data().tblparser;

the "tblparser" object would depend of the "elem". You can use the API Interface to know the relationship and get the attribute available.

If you want, you can access it directly from the Firebox console, something like this

console.log($('table:eq(0)').data().tblparser);

API Interface

On my Table Usability Concept github project you will find the full API listed here https://github.com/duboisp/Table-Usability-Concept/tree/master/API You will need to use the API under "Table Parser - WET 3.0 release" header.

If you have any question regarding the API or about the Table Usability Concept, don't hesitate to submit an issue (https://github.com/duboisp/Table-Usability-Concept/issues/new)

Example of use

If you are looking about how to get access to the parsed tabular data take a look at

HTML Table Validator

Zebra Stripping Chart and Graph

HTML Table Validator TODO List

  • Add implicit ids/headers relationship instead of exclusively doing explicit
  • Warn the user of the presence of a possible complex table when a data cell or a summary cell span in multiple columns or multiple rows. That is not usual for simple table.
  • Add an option for tolerance for data cell colspan > 1 or rowspan > 1 in regard of determining if they are simple or complex tables.
  • Do some research about implementing a javascript XML parser that would re-format the HTML output instead of using the SGML browser parser.