Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / HTML::TableExtract.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "HTML::TableExtract 3"
132.TH HTML::TableExtract 3 "2002-04-04" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134HTML::TableExtract \- Perl extension for extracting the text contained in tables within an HTML document.
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 3
138\& # Matched tables are returned as "table state" objects; tables can be
139\& # matched using column headers, depth, count within a depth, or some
140\& # combination of the three.
141.Ve
142.PP
143.Vb 5
144\& # Using column header information. Assume an HTML document with
145\& # tables that have "Date", "Price", and "Cost" somewhere in a
146\& # row. The columns beneath those headings are what you want to
147\& # extract. They will be returned in the same order as you specified
148\& # the headers since 'automap' is enabled by default.
149.Ve
150.PP
151.Vb 3
152\& use HTML::TableExtract;
153\& $te = new HTML::TableExtract( headers => [qw(Date Price Cost)] );
154\& $te->parse($html_string);
155.Ve
156.PP
157.Vb 7
158\& # Examine all matching tables
159\& foreach $ts ($te->table_states) {
160\& print "Table (", join(',', $ts->coords), "):\en";
161\& foreach $row ($ts->rows) {
162\& print join(',', @$row), "\en";
163\& }
164\& }
165.Ve
166.PP
167.Vb 7
168\& # Old style, using top level methods rather than table state objects.
169\& foreach $table ($te->tables) {
170\& print "Table (", join(',', $te->table_coords($table)), "):\en";
171\& foreach $row ($te->rows($table)) {
172\& print join(',', @$row), "\en";
173\& }
174\& }
175.Ve
176.PP
177.Vb 5
178\& # Shorthand...top level rows() method assumes the first table found
179\& # in the document if no arguments are supplied.
180\& foreach $row ($te->rows) {
181\& print join(',', @$row), "\en";
182\& }
183.Ve
184.PP
185.Vb 7
186\& # Using depth and count information. Every table in the document has
187\& # a unique depth and count tuple, so when both are specified it is a
188\& # unique table. Depth and count both begin with 0, so in this case we
189\& # are looking for a table (depth 2) within a table (depth 1) within a
190\& # table (depth 0, which is the top level HTML document). In addition,
191\& # it must be the third (count 2) such instance of a table at that
192\& # depth.
193.Ve
194.PP
195.Vb 8
196\& $te = new HTML::TableExtract( depth => 2, count => 2 );
197\& $te->parse($html_string);
198\& foreach $ts ($te->table_states) {
199\& print "Table found at ", join(',', $ts->coords), ":\en";
200\& foreach $row ($ts->rows) {
201\& print " ", join(',', @$row), "\en";
202\& }
203\& }
204.Ve
205.SH "DESCRIPTION"
206.IX Header "DESCRIPTION"
207HTML::TableExtract is a subclass of HTML::Parser that serves to
208extract the textual information from tables of interest contained
209within an \s-1HTML\s0 document. The text from each extracted table is stored
210in tabe state objects which hold the information as an array of arrays
211that represent the rows and cells of that table.
212.PP
213There are three constraints available to specify which tables you
214would like to extract from a document: \fIHeaders\fR, \fIDepth\fR, and
215\&\fICount\fR.
216.PP
217\&\fIHeaders\fR, the most flexible and adaptive of the techniques, involves
218specifying text in an array that you expect to appear above the data
219in the tables of interest. Once all headers have been located in a row
220of that table, all further cells beneath the columns that matched your
221headers are extracted. All other columns are ignored: think of it as
222vertical slices through a table. In addition, TableExtract
223automatically rearranges each row in the same order as the headers you
224provided. If you would like to disable this, set \fIautomap\fR to 0
225during object creation, and instead rely on the \fIcolumn_map()\fR method to
226find out the order in which the headers were found. Furthermore,
227TableExtract will automatically compensate for cell span issues so
228that columns are really the same columns as you would visually see in
229a browser. This behavior can be disabled by setting the \fIgridmap\fR
230parameter to 0. \s-1HTML\s0 is stripped from the entire textual content of a
231cell before header matches are attempted \*(-- unless the \fIkeep_html\fR
232parameter was enabled.
233.PP
234\&\fIDepth\fR and \fICount\fR are more specific ways to specify tables in
235relation to one another. \fIDepth\fR represents how deeply a table
236resides in other tables. The depth of a top-level table in the
237document is 0. A table within a top-level table has a depth of 1, and
238so on. Each depth can be thought of as a layer; tables sharing the
239same depth are on the same layer. Within each of these layers,
240\&\fICount\fR represents the order in which a table was seen at that depth,
241starting with 0. Providing both a \fIdepth\fR and a \fIcount\fR will
242uniquely specify a table within a document.
243.PP
244Each of the \fIHeaders\fR, \fIDepth\fR, and \fICount\fR specifications are
245cumulative in their effect on the overall extraction. For instance, if
246you specify only a \fIDepth\fR, then you get all tables at that depth
247(note that these could very well reside in separate higher-level
248tables throughout the document since depth extends across tables). If
249you specify only a \fICount\fR, then the tables at that \fICount\fR from all
250depths are returned (i.e., the \fIn\fRth occurrence of a table at each
251depth). If you only specify \fIHeaders\fR, then you get all tables in the
252document containing those column headers. If you have specified
253multiple constraints of \fIHeaders\fR, \fIDepth\fR, and \fICount\fR, then each
254constraint has veto power over whether a particular table is
255extracted.
256.PP
257If no \fIHeaders\fR, \fIDepth\fR, or \fICount\fR are specified, then all
258tables match.
259.PP
260Text that is gathered from the tables is decoded with HTML::Entities
261by default; this can be disabled by setting the \fIdecode\fR parameter to
2620.
263.Sh "Chains"
264.IX Subsection "Chains"
265Make sure you fully understand the notions of \fIdepth\fR and \fIcount\fR
266before proceeding, because it is about to become a bit more involved.
267.PP
268Table matches using \fIHeaders\fR, \fIDepth\fR, or \fICount\fR can be chained
269together in order to further specify tables relative to one
270another. Links in chains are successively applied to tables within
271tables. Top level constraints (i.e., \fIheader\fR, \fIdepth\fR, and \fIcount\fR
272parameters for the TableExtract object) behave as the first link in
273the chain. Additional links are specified using the \fIchain\fR
274parameter. Each link in the chain has its own set of constraints. For
275example:
276.PP
277.Vb 8
278\& $te = new HTML::TableExtract
279\& (
280\& headers => [qw(Summary Region)],
281\& chain => [
282\& { depth => 0, count => 2 },
283\& { headers => [qw(Part Qty Cost)] }
284\& ],
285\& );
286.Ve
287.PP
288The matching process in this case will start with \fBall\fR tables in the
289document that have \*(L"Summary\*(R" and \*(L"Region\*(R" in their headers. For now,
290assume that there was only one table that matched these headers. Each
291table contained within that table will be compared to the first link
292in the chain. Depth 0 means that a matching table must be immediately
293contained within the current table; count 2 means that the matching
294table must also be the third at that depth (counts and depths start at
2950). In other words, the next link of the chain will match on the
296third table immediately contained within our first matched table. Once
297this link matches, then \fBall\fR further tables beneath that table that
298have \*(L"Part\*(R", \*(L"Qty\*(R", and \*(L"Cost\*(R" in their headers will match. By
299default, it is only tables at the end of the chains that are returned
300to the application, so these tables are returned.
301.PP
302Each time a link in a chain matches a table, an additional context for
303\&\fIdepth\fR and \fIcount\fR is established. It is perhaps easiest to
304visualize a \fIcontext\fR as a brand-new \s-1HTML\s0 document, with new depths
305and counts to compare to the remaining links in the chain. The top
306level \s-1HTML\s0 document is the first context. Each table in the document
307establishes a new context. \fIDepth\fR in a chain link is relative to the
308context that the matching table creates (i.e., a link depth of 0 would
309be a table immediately contained within the table that matched the
310prior link in the chain). Likewise, that same context keeps track of
311\&\fIcounts\fR within the new depth scheme for comparison to the remaining
312links in the chain. Headers still apply if they are present in a link,
313but they are always independent of context.
314.PP
315As it turns out, specifying a depth and count provides a unique
316address for a table within a context. For non-unique constraints, such
317as just a depth, or headers, there can be multiple matches for a given
318link. In these cases the chain \*(L"forks\*(R" and attempts to make further
319matches within each of these tables.
320.PP
321By default, chains are \fIelastic\fR. This means that when a particular
322link does not match on a table, it is passed down to subtables
323unchanged. For example:
324.PP
325.Vb 7
326\& $te = new HTML::TableExtract
327\& (
328\& headers => [qw(Summary Region)],
329\& chain => [
330\& { headers => [qw(Part Qty Cost)] }
331\& ],
332\& );
333.Ve
334.PP
335If there are intervening tables between the two header queries, they
336will be ignored; this query will extract all tables with \*(L"Part\*(R",
337\&\*(L"Qty\*(R", and \*(L"Cost\*(R" in the headers that are contained in any table with
338\&\*(L"Summary\*(R" and \*(L"Region\*(R" in its headers, regardless of how embedded the
339inner tables are. If you want a chain to be inelastic, you can set the
340\&\fIelastic\fR parameter to 0 for the whole TableExtract object. Using the
341same example:
342.PP
343.Vb 8
344\& $te = new HTML::TableExtract
345\& (
346\& headers => [qw(Summary Region)],
347\& chain => [
348\& { headers => [qw(Part Qty Cost)] }
349\& ],
350\& elastic => 0,
351\& );
352.Ve
353.PP
354In this case, the inner table (Part, Qty, Cost) must be \fBimmediately\fR
355contained within the outer table (Summary, Region) in order for the
356match to take place. This is equivalent to specifying a depth of 0 for
357each link in the chain; if you only want particular links to be
358inelastic, then simply set their depths to 0.
359.PP
360By default, only tables that match at the end of the chains are
361retained. The intermediate matches along the chain are referred to as
362\&\fIwaypoints\fR, and are not extracted by default. A waypoint may be
363retained, however, by specifiying the \fIkeep\fR parameter in that link
364of the chain. This parameter may be specified at the top level as well
365if you want to keep tables that match the first set of constraints in
366the object. If you want to keep all tables that match along the chain,
367the specify the \fIkeepall\fR parameter at the top level.
368.PP
369Are chains overkill? Probably. In reality, nested \s-1HTML\s0 tables tend not
370to be very deep, so there will usually not be much need for lots of
371links in a chain. Theoretically, however, chains offer precise
372targeting of tables relative to one another, no matter how deeply
373nested they are.
374.Sh "Pop Quiz"
375.IX Subsection "Pop Quiz"
376What happens with the following table extraction?
377.PP
378.Vb 3
379\& $te = new HTML::TableExtract(
380\& chain => [ { depth => 0 } ],
381\& );
382.Ve
383.PP
384Answer: All tables that are contained in another table are extracted
385from the document. In this case, there were no top-level constraints
386specified, which if you recall means that \fBall\fR tables match the
387first set of constraints (or non\-constraints, in this case!). A depth
388of 0 in the next link of the chain means that the matching table must
389be immediately contained within the table from a prior match.
390.PP
391The following is equivalent:
392.PP
393.Vb 4
394\& $te = new HTML::TableExtract(
395\& depth => 1,
396\& subtables => 1,
397\& )
398.Ve
399.PP
400The \fIsubtables\fR parameter tells TableExtract to scoop up all tables
401contained within the matching tables. In conjunction with a depth of
4021, this has the affect of discarding all top-level tables in the
403document, which is exactly what occurred in the prior example.
404.Sh "Advice"
405.IX Subsection "Advice"
406The main point of this module was to provide a flexible method of
407extracting tabular information from \s-1HTML\s0 documents without relying to
408heavily on the document layout. For that reason, I suggest using
409\&\fIHeaders\fR whenever possible \*(-- that way, you are anchoring your
410extraction on what the document is trying to communicate rather than
411some feature of the \s-1HTML\s0 comprising the document (other than the fact
412that the data is contained in a table).
413.PP
414HTML::TableExtract is a subclass of HTML::Parser, and as such inherits
415all of its basic methods. In particular, \f(CW\*(C`start()\*(C'\fR, \f(CW\*(C`end()\*(C'\fR, and
416\&\f(CW\*(C`text()\*(C'\fR are utilized. Feel free to override them, but if you do not
417eventually invoke them in the \s-1SUPER\s0 class with some content, results
418are not guaranteed.
419.SH "METHODS"
420.IX Header "METHODS"
421The following are the top-level methods of the HTML::TableExtract
422object. Tables that have matched a query are actually returned as
423separate objects of type HTML::TableExtract::TableState. These table
424state objects have their own methods, documented further below. There
425are some top-level methods that are present for convenience and
426backwards compatibility that are nothing more than front-ends for
427equivalent table state methods.
428.Sh "Constructor"
429.IX Subsection "Constructor"
430.IP "\fInew()\fR" 4
431.IX Item "new()"
432Return a new HTML::TableExtract object. Valid attributes are:
433.RS 4
434.IP "headers" 4
435.IX Item "headers"
436Passed as an array reference, headers specify strings of interest at
437the top of columns within targeted tables. These header strings will
438eventually be passed through a non\-anchored, case-insensitive regular
439expression, so regexp special characters are allowed. The table row
440containing the headers is \fBnot\fR returned. Columns that are not
441beneath one of the provided headers will be ignored. Columns will, by
442default, be rearranged into the same order as the headers you provide
443(see the \fIautomap\fR parameter for more information). Additionally, by
444default columns are considered what you would see visually beneath
445that header when the table is rendered in a browser. See the
446\&\fIgridmap\fR parameter for more information. \s-1HTML\s0 within a header is
447stripped before the match is attempted, unless the \fBkeep_html\fR
448parameter was specified.
449.IP "depth" 4
450.IX Item "depth"
451Specify how embedded in other tables your tables of interest should
452be. Top-level tables in the \s-1HTML\s0 document have a depth of 0, tables
453within top-level tables have a depth of 1, and so on.
454.IP "count" 4
455.IX Item "count"
456Specify which table within each depth you are interested in, beginning
457with 0.
458.IP "chain" 4
459.IX Item "chain"
460List of additional constraints to be matched sequentially from the top
461level constraints. This is a reference to an array of hash
462references. Each hash is a link in the chain, and can be specified in
463terms of \fIdepth\fR, \fIcount\fR, and \fIheaders\fR. Further modifiers include
464\&\fIkeep\fR, which means to retain the table if it would normally be
465dropped as a waypoint.
466.IP "automap" 4
467.IX Item "automap"
468Automatically applies the ordering reported by \fIcolumn_map()\fR to the
469rows returned by \fIrows()\fR. This only makes a difference if you have
470specified \fIHeaders\fR and they turn out to be in a different order in
471the table than what you specified. Automap will rearrange the columns
472in the same order as the headers appear. To get the original ordering,
473you will need to take another slice of each row using
474\&\fIcolumn_map()\fR. \fIautomap\fR is enabled by default.
475.IP "gridmap" 4
476.IX Item "gridmap"
477Controls whether the table contents are returned as a grid or a
478tree. \s-1ROWSPAN\s0 and \s-1COLSPAN\s0 issues are compensated for, and columns
479really are columns. Empty phantom cells are created where they would
480have been obscured by \s-1ROWSPAN\s0 or \s-1COLSPAN\s0 settings. This really becomes
481an issue when extracting columns beneath headers. Enabled by default.
482.IP "keepall" 4
483.IX Item "keepall"
484Keep all tables that matched along a chain, including tables matched
485by top level contraints. By default, waypoints are dropped and only
486the matches at the end of the chain are retained. To retain a
487particular waypoint along a chain, use the \fIkeep\fR parameter in that
488link.
489.IP "elastic" 4
490.IX Item "elastic"
491When set to 0, all links in chains will be treated as though they had
492a depth of 0 specified, which means there can be no intervening
493unmatched tables between matches on links.
494.IP "subtables" 4
495.IX Item "subtables"
496Extract all tables within matched tables.
497.IP "decode" 4
498.IX Item "decode"
499Automatically decode retrieved text with
500\&\fIHTML::Entities::decode_entities()\fR. Enabled by default.
501.IP "br_translate" 4
502.IX Item "br_translate"
503Translate <br> tags into newlines. Sometimes the remaining text can be
504hard to parse if the <br> tag is simply dropped. Enabled by default.
505Has no effect if \fIkeep_html\fR is enabled.
506.IP "keep_html" 4
507.IX Item "keep_html"
508Return the raw \s-1HTML\s0 contained in the cell, rather than just the
509visible text. Embedded tables are \fBnot\fR retained in the \s-1HTML\s0
510extracted from a cell. Patterns for header matches must take into
511account \s-1HTML\s0 in the string if this option is enabled.
512.IP "debug" 4
513.IX Item "debug"
514Prints some debugging information to \s-1STDOUT\s0, more for higher values.
515.RE
516.RS 4
517.Sh "Regular Methods"
518.IX Subsection "Regular Methods"
519.RE
520.IP "\fIdepths()\fR" 4
521.IX Item "depths()"
522Returns all depths that contained matched tables in the document.
523.IP "counts($depth)" 4
524.IX Item "counts($depth)"
525For a particular depth, returns all counts that contained matched
526tables.
527.ie n .IP "table_state($depth, $count)" 4
528.el .IP "table_state($depth, \f(CW$count\fR)" 4
529.IX Item "table_state($depth, $count)"
530For a particular depth and count, return the table state object for
531the table found, if any.
532.IP "\fItable_states()\fR" 4
533.IX Item "table_states()"
534Return table state objects for all tables that matched.
535.IP "\fIfirst_table_state_found()\fR" 4
536.IX Item "first_table_state_found()"
537Return the table state object for the first table matched in the
538document.
539.Sh "\s-1TABLE\s0 \s-1STATE\s0 \s-1METHODS\s0"
540.IX Subsection "TABLE STATE METHODS"
541The following methods are invoked from an
542HTML::TableExtract::TableState object, such as those returned from the
543\&\f(CW\*(C`table_states()\*(C'\fR method.
544.IP "\fIrows()\fR" 4
545.IX Item "rows()"
546Return all rows within a matched table. Each row returned is a
547reference to an array containing the text of each cell.
548.IP "\fIdepth()\fR" 4
549.IX Item "depth()"
550Return the (absolute) depth at which this table was found.
551.IP "\fIcount()\fR" 4
552.IX Item "count()"
553Return the count for this table within the depth it was found.
554.IP "\fIcoords()\fR" 4
555.IX Item "coords()"
556Return depth and count in a list.
557.IP "\fIcolumn_map()\fR" 4
558.IX Item "column_map()"
559Return the order (via indices) in which the provided headers were
560found. These indices can be used as slices on rows to either order the
561rows in the same order as headers or restore the rows to their natural
562order, depending on whether the rows have been pre-adjusted using the
563\&\fIautomap\fR parameter.
564.IP "\fIlineage()\fR" 4
565.IX Item "lineage()"
566Returns the path of matched tables that led to matching this
567table. Lineage only makes sense if chains were used. Tables that were
568not matched by a link in the chain are not included in lineage. The
569lineage path is a list of array refs containing depth and count values
570for each table involved.
571.Sh "Procedural Methods"
572.IX Subsection "Procedural Methods"
573The following top level methods are alternatives to invoking methods
574in a table state object. If you do not want to deal with table state
575objects, then these methods are for you. The \*(L"tables\*(R" they deal in are
576actually just arrays of arrays, which happen to be the current
577internal data structure of the table state objects. They are here for
578backwards compatibility.
579.ie n .IP "table($depth, $count)" 4
580.el .IP "table($depth, \f(CW$count\fR)" 4
581.IX Item "table($depth, $count)"
582Same as \f(CW\*(C`table_state()\*(C'\fR, but returns the internal data structure
583rather than the table state object.
584.IP "\fItables()\fR" 4
585.IX Item "tables()"
586Same as \f(CW\*(C`table_states()\*(C'\fR, but returns the data structures rather than
587the table state objects.
588.IP "\fIfirst_table_found()\fR" 4
589.IX Item "first_table_found()"
590Same as \f(CW\*(C`first_table_state_found()\*(C'\fR, except returns the data
591structure for first table that matched.
592.IP "table_coords($table)" 4
593.IX Item "table_coords($table)"
594Returns the depth and count for a particular table data structure. See
595the \f(CW\*(C`coords()\*(C'\fR method provided by table state objects.
596.IP "\fIrows()\fR" 4
597.IX Item "rows()"
598.PD 0
599.IP "rows($table)" 4
600.IX Item "rows($table)"
601.PD
602Return a lsit of the rows for a particular table data structure (first
603table found by default). See the \f(CW\*(C`rows()\*(C'\fR method provided by table
604state objects.
605.IP "\fIcolumn_map()\fR" 4
606.IX Item "column_map()"
607.PD 0
608.IP "column_map($table)" 4
609.IX Item "column_map($table)"
610.PD
611Return the column map for a particular table data structure (first
612found by default). See the \f(CW\*(C`column_map()\*(C'\fR method provided by table
613state objects.
614.SH "REQUIRES"
615.IX Header "REQUIRES"
616\&\fIHTML::Parser\fR\|(3), \fIHTML::Entities\fR\|(3)
617.SH "AUTHOR"
618.IX Header "AUTHOR"
619Matthew P. Sisk, <\fIsisk@mojotoad.com\fR>
620.SH "COPYRIGHT"
621.IX Header "COPYRIGHT"
622Copyright (c) 2000\-2002 Matthew P. Sisk.
623All rights reserved. All wrongs revenged. This program is free
624software; you can redistribute it and/or modify it under the
625same terms as Perl itself.
626.SH "SEE ALSO"
627.IX Header "SEE ALSO"
628\&\fIHTML::Parser\fR\|(3), \fIperl\fR\|(1).