home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / pytexdoc / ext / lib / lib2 / htmllib / tex
LaTeX Document  |  1996-11-08  |  4.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 53 74 61 6e 64 61 72 |\section|{Standar|
|00000010| 64 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |d Module| \sectco|
|00000020| 64 65 7b 68 74 6d 6c 6c | 69 62 7d 7d 0a 5c 73 74 |de{htmll|ib}}.\st|
|00000030| 6d 6f 64 69 6e 64 65 78 | 7b 68 74 6d 6c 6c 69 62 |modindex|{htmllib|
|00000040| 7d 0a 5c 69 6e 64 65 78 | 7b 48 54 4d 4c 7d 0a 5c |}.\index|{HTML}.\|
|00000050| 69 6e 64 65 78 7b 68 79 | 70 65 72 74 65 78 74 7d |index{hy|pertext}|
|00000060| 0a 0a 5c 72 65 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b |..\renew|command{|
|00000070| 5c 69 6e 64 65 78 73 75 | 62 69 74 65 6d 7d 7b 28 |\indexsu|bitem}{(|
|00000080| 69 6e 20 6d 6f 64 75 6c | 65 20 68 74 6d 6c 6c 69 |in modul|e htmlli|
|00000090| 62 29 7d 0a 0a 54 68 69 | 73 20 6d 6f 64 75 6c 65 |b)}..Thi|s module|
|000000a0| 20 64 65 66 69 6e 65 73 | 20 61 20 63 6c 61 73 73 | defines| a class|
|000000b0| 20 77 68 69 63 68 20 63 | 61 6e 20 73 65 72 76 65 | which c|an serve|
|000000c0| 20 61 73 20 61 20 62 61 | 73 65 20 66 6f 72 20 70 | as a ba|se for p|
|000000d0| 61 72 73 69 6e 67 20 74 | 65 78 74 0a 66 69 6c 65 |arsing t|ext.file|
|000000e0| 73 20 66 6f 72 6d 61 74 | 74 65 64 20 69 6e 20 74 |s format|ted in t|
|000000f0| 68 65 20 48 79 70 65 72 | 54 65 78 74 20 4d 61 72 |he Hyper|Text Mar|
|00000100| 6b 2d 75 70 20 4c 61 6e | 67 75 61 67 65 20 28 48 |k-up Lan|guage (H|
|00000110| 54 4d 4c 29 2e 20 20 54 | 68 65 20 63 6c 61 73 73 |TML). T|he class|
|00000120| 0a 69 73 20 6e 6f 74 20 | 64 69 72 65 63 74 6c 79 |.is not |directly|
|00000130| 20 63 6f 6e 63 65 72 6e | 65 64 20 77 69 74 68 20 | concern|ed with |
|00000140| 49 2f 4f 20 2d 2d 2d 20 | 69 74 20 6d 75 73 74 20 |I/O --- |it must |
|00000150| 62 65 20 70 72 6f 76 69 | 64 65 64 20 77 69 74 68 |be provi|ded with|
|00000160| 20 69 6e 70 75 74 0a 69 | 6e 20 73 74 72 69 6e 67 | input.i|n string|
|00000170| 20 66 6f 72 6d 20 76 69 | 61 20 61 20 6d 65 74 68 | form vi|a a meth|
|00000180| 6f 64 2c 20 61 6e 64 20 | 6d 61 6b 65 73 20 63 61 |od, and |makes ca|
|00000190| 6c 6c 73 20 74 6f 20 6d | 65 74 68 6f 64 73 20 6f |lls to m|ethods o|
|000001a0| 66 20 61 0a 60 60 66 6f | 72 6d 61 74 74 65 72 27 |f a.``fo|rmatter'|
|000001b0| 27 20 6f 62 6a 65 63 74 | 20 69 6e 20 6f 72 64 65 |' object| in orde|
|000001c0| 72 20 74 6f 20 70 72 6f | 64 75 63 65 20 6f 75 74 |r to pro|duce out|
|000001d0| 70 75 74 2e 20 20 54 68 | 65 0a 5c 63 6f 64 65 7b |put. Th|e.\code{|
|000001e0| 48 54 4d 4c 50 61 72 73 | 65 72 7d 20 63 6c 61 73 |HTMLPars|er} clas|
|000001f0| 73 20 69 73 20 64 65 73 | 69 67 6e 65 64 20 74 6f |s is des|igned to|
|00000200| 20 62 65 20 75 73 65 64 | 20 61 73 20 61 20 62 61 | be used| as a ba|
|00000210| 73 65 20 63 6c 61 73 73 | 20 66 6f 72 0a 6f 74 68 |se class| for.oth|
|00000220| 65 72 20 63 6c 61 73 73 | 65 73 20 69 6e 20 6f 72 |er class|es in or|
|00000230| 64 65 72 20 74 6f 20 61 | 64 64 20 66 75 6e 63 74 |der to a|dd funct|
|00000240| 69 6f 6e 61 6c 69 74 79 | 2c 20 61 6e 64 20 61 6c |ionality|, and al|
|00000250| 6c 6f 77 73 20 6d 6f 73 | 74 20 6f 66 20 69 74 73 |lows mos|t of its|
|00000260| 0a 6d 65 74 68 6f 64 73 | 20 74 6f 20 62 65 20 65 |.methods| to be e|
|00000270| 78 74 65 6e 64 65 64 20 | 6f 72 20 6f 76 65 72 72 |xtended |or overr|
|00000280| 69 64 64 65 6e 2e 20 20 | 49 6e 20 74 75 72 6e 2c |idden. |In turn,|
|00000290| 20 74 68 69 73 20 63 6c | 61 73 73 20 69 73 20 64 | this cl|ass is d|
|000002a0| 65 72 69 76 65 64 0a 66 | 72 6f 6d 20 61 6e 64 20 |erived.f|rom and |
|000002b0| 65 78 74 65 6e 64 73 20 | 74 68 65 20 5c 63 6f 64 |extends |the \cod|
|000002c0| 65 7b 53 47 4d 4c 50 61 | 72 73 65 72 7d 20 63 6c |e{SGMLPa|rser} cl|
|000002d0| 61 73 73 20 64 65 66 69 | 6e 65 64 20 69 6e 20 6d |ass defi|ned in m|
|000002e0| 6f 64 75 6c 65 0a 5c 63 | 6f 64 65 7b 73 67 6d 6c |odule.\c|ode{sgml|
|000002f0| 6c 69 62 7d 2e 20 20 54 | 77 6f 20 69 6d 70 6c 65 |lib}. T|wo imple|
|00000300| 6d 65 6e 74 61 74 69 6f | 6e 73 20 6f 66 20 66 6f |mentatio|ns of fo|
|00000310| 72 6d 61 74 74 65 72 20 | 6f 62 6a 65 63 74 73 20 |rmatter |objects |
|00000320| 61 72 65 0a 70 72 6f 76 | 69 64 65 64 20 69 6e 20 |are.prov|ided in |
|00000330| 74 68 65 20 5c 63 6f 64 | 65 7b 66 6f 72 6d 61 74 |the \cod|e{format|
|00000340| 74 65 72 7d 20 6d 6f 64 | 75 6c 65 3b 20 72 65 66 |ter} mod|ule; ref|
|00000350| 65 72 20 74 6f 20 74 68 | 65 20 64 6f 63 75 6d 65 |er to th|e docume|
|00000360| 6e 74 61 74 69 6f 6e 0a | 66 6f 72 20 74 68 61 74 |ntation.|for that|
|00000370| 20 6d 6f 64 75 6c 65 20 | 66 6f 72 20 69 6e 66 6f | module |for info|
|00000380| 72 6d 61 74 69 6f 6e 20 | 6f 6e 20 74 68 65 20 66 |rmation |on the f|
|00000390| 6f 72 6d 61 74 74 65 72 | 20 69 6e 74 65 72 66 61 |ormatter| interfa|
|000003a0| 63 65 2e 0a 5c 69 6e 64 | 65 78 7b 53 47 4d 4c 7d |ce..\ind|ex{SGML}|
|000003b0| 0a 5c 73 74 6d 6f 64 69 | 6e 64 65 78 7b 73 67 6d |.\stmodi|ndex{sgm|
|000003c0| 6c 6c 69 62 7d 0a 5c 74 | 74 69 6e 64 65 78 7b 53 |llib}.\t|tindex{S|
|000003d0| 47 4d 4c 50 61 72 73 65 | 72 7d 0a 5c 69 6e 64 65 |GMLParse|r}.\inde|
|000003e0| 78 7b 66 6f 72 6d 61 74 | 74 65 72 7d 0a 5c 73 74 |x{format|ter}.\st|
|000003f0| 6d 6f 64 69 6e 64 65 78 | 7b 66 6f 72 6d 61 74 74 |modindex|{formatt|
|00000400| 65 72 7d 0a 0a 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |er}..The| followi|
|00000410| 6e 67 20 69 73 20 61 20 | 73 75 6d 6d 61 72 79 20 |ng is a |summary |
|00000420| 6f 66 20 74 68 65 20 69 | 6e 74 65 72 66 61 63 65 |of the i|nterface|
|00000430| 20 64 65 66 69 6e 65 64 | 20 62 79 0a 5c 63 6f 64 | defined| by.\cod|
|00000440| 65 7b 73 67 6d 6c 6c 69 | 62 2e 53 47 4d 4c 50 61 |e{sgmlli|b.SGMLPa|
|00000450| 72 73 65 72 7d 3a 0a 0a | 5c 62 65 67 69 6e 7b 69 |rser}:..|\begin{i|
|00000460| 74 65 6d 69 7a 65 7d 0a | 0a 5c 69 74 65 6d 0a 54 |temize}.|.\item.T|
|00000470| 68 65 20 69 6e 74 65 72 | 66 61 63 65 20 74 6f 20 |he inter|face to |
|00000480| 66 65 65 64 20 64 61 74 | 61 20 74 6f 20 61 6e 20 |feed dat|a to an |
|00000490| 69 6e 73 74 61 6e 63 65 | 20 69 73 20 74 68 72 6f |instance| is thro|
|000004a0| 75 67 68 20 74 68 65 20 | 5c 63 6f 64 65 7b 66 65 |ugh the |\code{fe|
|000004b0| 65 64 28 29 7d 0a 6d 65 | 74 68 6f 64 2c 20 77 68 |ed()}.me|thod, wh|
|000004c0| 69 63 68 20 74 61 6b 65 | 73 20 61 20 73 74 72 69 |ich take|s a stri|
|000004d0| 6e 67 20 61 72 67 75 6d | 65 6e 74 2e 20 20 54 68 |ng argum|ent. Th|
|000004e0| 69 73 20 63 61 6e 20 62 | 65 20 63 61 6c 6c 65 64 |is can b|e called|
|000004f0| 20 77 69 74 68 20 61 73 | 0a 6c 69 74 74 6c 65 20 | with as|.little |
|00000500| 6f 72 20 61 73 20 6d 75 | 63 68 20 74 65 78 74 20 |or as mu|ch text |
|00000510| 61 74 20 61 20 74 69 6d | 65 20 61 73 20 64 65 73 |at a tim|e as des|
|00000520| 69 72 65 64 3b 20 5c 63 | 6f 64 65 7b 70 2e 66 65 |ired; \c|ode{p.fe|
|00000530| 65 64 28 61 29 3b 0a 70 | 2e 66 65 65 64 28 62 29 |ed(a);.p|.feed(b)|
|00000540| 7d 20 68 61 73 20 74 68 | 65 20 73 61 6d 65 20 65 |} has th|e same e|
|00000550| 66 66 65 63 74 20 61 73 | 20 5c 63 6f 64 65 7b 70 |ffect as| \code{p|
|00000560| 2e 66 65 65 64 28 61 2b | 62 29 7d 2e 20 20 57 68 |.feed(a+|b)}. Wh|
|00000570| 65 6e 20 74 68 65 20 64 | 61 74 61 0a 63 6f 6e 74 |en the d|ata.cont|
|00000580| 61 69 6e 73 20 63 6f 6d | 70 6c 65 74 65 20 48 54 |ains com|plete HT|
|00000590| 4d 4c 20 74 61 67 73 2c | 20 74 68 65 73 65 20 61 |ML tags,| these a|
|000005a0| 72 65 20 70 72 6f 63 65 | 73 73 65 64 20 69 6d 6d |re proce|ssed imm|
|000005b0| 65 64 69 61 74 65 6c 79 | 3b 0a 69 6e 63 6f 6d 70 |ediately|;.incomp|
|000005c0| 6c 65 74 65 20 65 6c 65 | 6d 65 6e 74 73 20 61 72 |lete ele|ments ar|
|000005d0| 65 20 73 61 76 65 64 20 | 69 6e 20 61 20 62 75 66 |e saved |in a buf|
|000005e0| 66 65 72 2e 20 20 54 6f | 20 66 6f 72 63 65 20 70 |fer. To| force p|
|000005f0| 72 6f 63 65 73 73 69 6e | 67 20 6f 66 20 61 6c 6c |rocessin|g of all|
|00000600| 0a 75 6e 70 72 6f 63 65 | 73 73 65 64 20 64 61 74 |.unproce|ssed dat|
|00000610| 61 2c 20 63 61 6c 6c 20 | 74 68 65 20 5c 63 6f 64 |a, call |the \cod|
|00000620| 65 7b 63 6c 6f 73 65 28 | 29 7d 20 6d 65 74 68 6f |e{close(|)} metho|
|00000630| 64 2e 0a 0a 46 6f 72 20 | 65 78 61 6d 70 6c 65 2c |d...For |example,|
|00000640| 20 74 6f 20 70 61 72 73 | 65 20 74 68 65 20 65 6e | to pars|e the en|
|00000650| 74 69 72 65 20 63 6f 6e | 74 65 6e 74 73 20 6f 66 |tire con|tents of|
|00000660| 20 61 20 66 69 6c 65 2c | 20 75 73 65 3a 0a 5c 62 | a file,| use:.\b|
|00000670| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 70 |egin{ver|batim}.p|
|00000680| 61 72 73 65 72 2e 66 65 | 65 64 28 6f 70 65 6e 28 |arser.fe|ed(open(|
|00000690| 27 6d 79 66 69 6c 65 2e | 68 74 6d 6c 27 29 2e 72 |'myfile.|html').r|
|000006a0| 65 61 64 28 29 29 0a 70 | 61 72 73 65 72 2e 63 6c |ead()).p|arser.cl|
|000006b0| 6f 73 65 28 29 0a 5c 65 | 6e 64 7b 76 65 72 62 61 |ose().\e|nd{verba|
|000006c0| 74 69 6d 7d 0a 0a 5c 69 | 74 65 6d 0a 54 68 65 20 |tim}..\i|tem.The |
|000006d0| 69 6e 74 65 72 66 61 63 | 65 20 74 6f 20 64 65 66 |interfac|e to def|
|000006e0| 69 6e 65 20 73 65 6d 61 | 6e 74 69 63 73 20 66 6f |ine sema|ntics fo|
|000006f0| 72 20 48 54 4d 4c 20 74 | 61 67 73 20 69 73 20 76 |r HTML t|ags is v|
|00000700| 65 72 79 20 73 69 6d 70 | 6c 65 3a 20 64 65 72 69 |ery simp|le: deri|
|00000710| 76 65 0a 61 20 63 6c 61 | 73 73 20 61 6e 64 20 64 |ve.a cla|ss and d|
|00000720| 65 66 69 6e 65 20 6d 65 | 74 68 6f 64 73 20 63 61 |efine me|thods ca|
|00000730| 6c 6c 65 64 20 5c 63 6f | 64 65 7b 73 74 61 72 74 |lled \co|de{start|
|00000740| 5f 5c 76 61 72 7b 74 61 | 67 7d 28 29 7d 2c 0a 5c |_\var{ta|g}()},.\|
|00000750| 63 6f 64 65 7b 65 6e 64 | 5f 5c 76 61 72 7b 74 61 |code{end|_\var{ta|
|00000760| 67 7d 28 29 7d 2c 20 6f | 72 20 5c 63 6f 64 65 7b |g}()}, o|r \code{|
|00000770| 64 6f 5f 5c 76 61 72 7b | 74 61 67 7d 28 29 7d 2e |do_\var{|tag}()}.|
|00000780| 20 20 54 68 65 20 70 61 | 72 73 65 72 20 77 69 6c | The pa|rser wil|
|00000790| 6c 0a 63 61 6c 6c 20 74 | 68 65 73 65 20 61 74 20 |l.call t|hese at |
|000007a0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 6d 6f 6d 65 |appropri|ate mome|
|000007b0| 6e 74 73 3a 20 5c 63 6f | 64 65 7b 73 74 61 72 74 |nts: \co|de{start|
|000007c0| 5f 5c 76 61 72 7b 74 61 | 67 7d 7d 20 6f 72 0a 5c |_\var{ta|g}} or.\|
|000007d0| 63 6f 64 65 7b 64 6f 5f | 5c 76 61 72 7b 74 61 67 |code{do_|\var{tag|
|000007e0| 7d 7d 20 69 73 20 63 61 | 6c 6c 65 64 20 77 68 65 |}} is ca|lled whe|
|000007f0| 6e 20 61 6e 20 6f 70 65 | 6e 69 6e 67 20 74 61 67 |n an ope|ning tag|
|00000800| 20 6f 66 20 74 68 65 20 | 66 6f 72 6d 0a 5c 63 6f | of the |form.\co|
|00000810| 64 65 7b 3c 5c 76 61 72 | 7b 74 61 67 7d 20 2e 2e |de{<\var|{tag} ..|
|00000820| 2e 3e 7d 20 69 73 20 65 | 6e 63 6f 75 6e 74 65 72 |.>} is e|ncounter|
|00000830| 65 64 3b 20 5c 63 6f 64 | 65 7b 65 6e 64 5f 5c 76 |ed; \cod|e{end_\v|
|00000840| 61 72 7b 74 61 67 7d 7d | 20 69 73 20 63 61 6c 6c |ar{tag}}| is call|
|00000850| 65 64 0a 77 68 65 6e 20 | 61 20 63 6c 6f 73 69 6e |ed.when |a closin|
|00000860| 67 20 74 61 67 20 6f 66 | 20 74 68 65 20 66 6f 72 |g tag of| the for|
|00000870| 6d 20 5c 63 6f 64 65 7b | 3c 5c 76 61 72 7b 74 61 |m \code{|<\var{ta|
|00000880| 67 7d 3e 7d 20 69 73 20 | 65 6e 63 6f 75 6e 74 65 |g}>} is |encounte|
|00000890| 72 65 64 2e 20 20 49 66 | 0a 61 6e 20 6f 70 65 6e |red. If|.an open|
|000008a0| 69 6e 67 20 74 61 67 20 | 72 65 71 75 69 72 65 73 |ing tag |requires|
|000008b0| 20 61 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 | a corre|sponding|
|000008c0| 20 63 6c 6f 73 69 6e 67 | 20 74 61 67 2c 20 6c 69 | closing| tag, li|
|000008d0| 6b 65 20 5c 63 6f 64 65 | 7b 3c 48 31 3e 7d 0a 2e |ke \code|{<H1>}..|
|000008e0| 2e 2e 20 5c 63 6f 64 65 | 7b 3c 2f 48 31 3e 7d 2c |.. \code|{</H1>},|
|000008f0| 20 74 68 65 20 63 6c 61 | 73 73 20 73 68 6f 75 6c | the cla|ss shoul|
|00000900| 64 20 64 65 66 69 6e 65 | 20 74 68 65 20 5c 63 6f |d define| the \co|
|00000910| 64 65 7b 73 74 61 72 74 | 5f 5c 76 61 72 7b 74 61 |de{start|_\var{ta|
|00000920| 67 7d 7d 0a 6d 65 74 68 | 6f 64 3b 20 69 66 20 61 |g}}.meth|od; if a|
|00000930| 20 74 61 67 20 72 65 71 | 75 69 72 65 73 20 6e 6f | tag req|uires no|
|00000940| 20 63 6c 6f 73 69 6e 67 | 20 74 61 67 2c 20 6c 69 | closing| tag, li|
|00000950| 6b 65 20 5c 63 6f 64 65 | 7b 3c 50 3e 7d 2c 20 74 |ke \code|{<P>}, t|
|00000960| 68 65 20 63 6c 61 73 73 | 0a 73 68 6f 75 6c 64 20 |he class|.should |
|00000970| 64 65 66 69 6e 65 20 74 | 68 65 20 5c 63 6f 64 65 |define t|he \code|
|00000980| 7b 64 6f 5f 5c 76 61 72 | 7b 74 61 67 7d 7d 20 6d |{do_\var|{tag}} m|
|00000990| 65 74 68 6f 64 2e 0a 0a | 5c 65 6e 64 7b 69 74 65 |ethod...|\end{ite|
|000009a0| 6d 69 7a 65 7d 0a 0a 54 | 68 65 20 6d 6f 64 75 6c |mize}..T|he modul|
|000009b0| 65 20 64 65 66 69 6e 65 | 73 20 61 20 73 69 6e 67 |e define|s a sing|
|000009c0| 6c 65 20 63 6c 61 73 73 | 3a 0a 0a 5c 62 65 67 69 |le class|:..\begi|
|000009d0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 48 54 4d 4c |n{funcde|sc}{HTML|
|000009e0| 50 61 72 73 65 72 7d 7b | 66 6f 72 6d 61 74 74 65 |Parser}{|formatte|
|000009f0| 72 7d 0a 54 68 69 73 20 | 69 73 20 74 68 65 20 62 |r}.This |is the b|
|00000a00| 61 73 69 63 20 48 54 4d | 4c 20 70 61 72 73 65 72 |asic HTM|L parser|
|00000a10| 20 63 6c 61 73 73 2e 20 | 20 49 74 20 73 75 70 70 | class. | It supp|
|00000a20| 6f 72 74 73 20 61 6c 6c | 20 65 6e 74 69 74 79 20 |orts all| entity |
|00000a30| 6e 61 6d 65 73 0a 72 65 | 71 75 69 72 65 64 20 62 |names.re|quired b|
|00000a40| 79 20 74 68 65 20 48 54 | 4d 4c 20 32 2e 30 20 73 |y the HT|ML 2.0 s|
|00000a50| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 20 28 52 46 |pecifica|tion (RF|
|00000a60| 43 20 31 38 36 36 29 2e | 20 20 49 74 20 61 6c 73 |C 1866).| It als|
|00000a70| 6f 20 64 65 66 69 6e 65 | 73 0a 68 61 6e 64 6c 65 |o define|s.handle|
|00000a80| 72 73 20 66 6f 72 20 61 | 6c 6c 20 48 54 4d 4c 20 |rs for a|ll HTML |
|00000a90| 32 2e 30 20 61 6e 64 20 | 6d 61 6e 79 20 48 54 4d |2.0 and |many HTM|
|00000aa0| 4c 20 33 2e 30 20 61 6e | 64 20 33 2e 32 20 65 6c |L 3.0 an|d 3.2 el|
|00000ab0| 65 6d 65 6e 74 73 2e 0a | 5c 65 6e 64 7b 66 75 6e |ements..|\end{fun|
|00000ac0| 63 64 65 73 63 7d 0a 0a | 49 6e 20 61 64 64 69 74 |cdesc}..|In addit|
|00000ad0| 69 6f 6e 20 74 6f 20 74 | 61 67 20 6d 65 74 68 6f |ion to t|ag metho|
|00000ae0| 64 73 2c 20 74 68 65 20 | 5c 63 6f 64 65 7b 48 54 |ds, the |\code{HT|
|00000af0| 4d 4c 50 61 72 73 65 72 | 7d 20 63 6c 61 73 73 20 |MLParser|} class |
|00000b00| 70 72 6f 76 69 64 65 73 | 20 73 6f 6d 65 0a 61 64 |provides| some.ad|
|00000b10| 64 69 74 69 6f 6e 61 6c | 20 6d 65 74 68 6f 64 73 |ditional| methods|
|00000b20| 20 61 6e 64 20 69 6e 73 | 74 61 6e 63 65 20 76 61 | and ins|tance va|
|00000b30| 72 69 61 62 6c 65 73 20 | 66 6f 72 20 75 73 65 20 |riables |for use |
|00000b40| 77 69 74 68 69 6e 20 74 | 61 67 20 6d 65 74 68 6f |within t|ag metho|
|00000b50| 64 73 2e 0a 0a 5c 72 65 | 6e 65 77 63 6f 6d 6d 61 |ds...\re|newcomma|
|00000b60| 6e 64 7b 5c 69 6e 64 65 | 78 73 75 62 69 74 65 6d |nd{\inde|xsubitem|
|00000b70| 7d 7b 28 7b 5c 74 74 20 | 48 54 4d 4c 50 61 72 73 |}{({\tt |HTMLPars|
|00000b80| 65 72 7d 20 6d 65 74 68 | 6f 64 29 7d 0a 0a 5c 62 |er} meth|od)}..\b|
|00000b90| 65 67 69 6e 7b 64 61 74 | 61 64 65 73 63 7d 7b 66 |egin{dat|adesc}{f|
|00000ba0| 6f 72 6d 61 74 74 65 72 | 7d 0a 54 68 69 73 20 69 |ormatter|}.This i|
|00000bb0| 73 20 74 68 65 20 66 6f | 72 6d 61 74 74 65 72 20 |s the fo|rmatter |
|00000bc0| 69 6e 73 74 61 6e 63 65 | 20 61 73 73 6f 63 69 61 |instance| associa|
|00000bd0| 74 65 64 20 77 69 74 68 | 20 74 68 65 20 70 61 72 |ted with| the par|
|00000be0| 73 65 72 2e 0a 5c 65 6e | 64 7b 64 61 74 61 64 65 |ser..\en|d{datade|
|00000bf0| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 64 61 74 61 |sc}..\be|gin{data|
|00000c00| 64 65 73 63 7d 7b 6e 6f | 66 69 6c 6c 7d 0a 42 6f |desc}{no|fill}.Bo|
|00000c10| 6f 6c 65 61 6e 20 66 6c | 61 67 20 77 68 69 63 68 |olean fl|ag which|
|00000c20| 20 73 68 6f 75 6c 64 20 | 62 65 20 74 72 75 65 20 | should |be true |
|00000c30| 77 68 65 6e 20 77 68 69 | 74 65 73 70 61 63 65 20 |when whi|tespace |
|00000c40| 73 68 6f 75 6c 64 20 6e | 6f 74 20 62 65 0a 63 6f |should n|ot be.co|
|00000c50| 6c 6c 61 70 73 65 64 2c | 20 6f 72 20 66 61 6c 73 |llapsed,| or fals|
|00000c60| 65 20 77 68 65 6e 20 69 | 74 20 73 68 6f 75 6c 64 |e when i|t should|
|00000c70| 20 62 65 2e 20 20 49 6e | 20 67 65 6e 65 72 61 6c | be. In| general|
|00000c80| 2c 20 74 68 69 73 20 73 | 68 6f 75 6c 64 20 6f 6e |, this s|hould on|
|00000c90| 6c 79 0a 62 65 20 74 72 | 75 65 20 77 68 65 6e 20 |ly.be tr|ue when |
|00000ca0| 63 68 61 72 61 63 74 65 | 72 20 64 61 74 61 20 69 |characte|r data i|
|00000cb0| 73 20 74 6f 20 62 65 20 | 74 72 65 61 74 65 64 20 |s to be |treated |
|00000cc0| 61 73 20 60 60 70 72 65 | 66 6f 72 6d 61 74 74 65 |as ``pre|formatte|
|00000cd0| 64 27 27 20 74 65 78 74 | 2c 0a 61 73 20 77 69 74 |d'' text|,.as wit|
|00000ce0| 68 69 6e 20 61 20 5c 63 | 6f 64 65 7b 3c 50 52 45 |hin a \c|ode{<PRE|
|00000cf0| 3e 7d 20 65 6c 65 6d 65 | 6e 74 2e 20 20 54 68 65 |>} eleme|nt. The|
|00000d00| 20 64 65 66 61 75 6c 74 | 20 76 61 6c 75 65 20 69 | default| value i|
|00000d10| 73 20 66 61 6c 73 65 2e | 20 20 54 68 69 73 0a 61 |s false.| This.a|
|00000d20| 66 66 65 63 74 73 20 74 | 68 65 20 6f 70 65 72 61 |ffects t|he opera|
|00000d30| 74 69 6f 6e 20 6f 66 20 | 5c 63 6f 64 65 7b 68 61 |tion of |\code{ha|
|00000d40| 6e 64 6c 65 5f 64 61 74 | 61 28 29 7d 20 61 6e 64 |ndle_dat|a()} and|
|00000d50| 20 5c 63 6f 64 65 7b 73 | 61 76 65 5f 65 6e 64 28 | \code{s|ave_end(|
|00000d60| 29 7d 2e 0a 5c 65 6e 64 | 7b 64 61 74 61 64 65 73 |)}..\end|{datades|
|00000d70| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000d80| 65 73 63 7d 7b 61 6e 63 | 68 6f 72 5f 62 67 6e 7d |esc}{anc|hor_bgn}|
|00000d90| 7b 68 72 65 66 5c 2c 20 | 6e 61 6d 65 5c 2c 20 74 |{href\, |name\, t|
|00000da0| 79 70 65 7d 0a 54 68 69 | 73 20 6d 65 74 68 6f 64 |ype}.Thi|s method|
|00000db0| 20 69 73 20 63 61 6c 6c | 65 64 20 61 74 20 74 68 | is call|ed at th|
|00000dc0| 65 20 73 74 61 72 74 20 | 6f 66 20 61 6e 20 61 6e |e start |of an an|
|00000dd0| 63 68 6f 72 20 72 65 67 | 69 6f 6e 2e 20 20 54 68 |chor reg|ion. Th|
|00000de0| 65 20 61 72 67 75 6d 65 | 6e 74 73 0a 63 6f 72 72 |e argume|nts.corr|
|00000df0| 65 73 70 6f 6e 64 20 74 | 6f 20 74 68 65 20 61 74 |espond t|o the at|
|00000e00| 74 72 69 62 75 74 65 73 | 20 6f 66 20 74 68 65 20 |tributes| of the |
|00000e10| 5c 63 6f 64 65 7b 3c 41 | 3e 7d 20 74 61 67 20 77 |\code{<A|>} tag w|
|00000e20| 69 74 68 20 74 68 65 20 | 73 61 6d 65 0a 6e 61 6d |ith the |same.nam|
|00000e30| 65 73 2e 20 20 54 68 65 | 20 64 65 66 61 75 6c 74 |es. The| default|
|00000e40| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 | impleme|ntation |
|00000e50| 6d 61 69 6e 74 61 69 6e | 73 20 61 20 6c 69 73 74 |maintain|s a list|
|00000e60| 20 6f 66 20 68 79 70 65 | 72 6c 69 6e 6b 73 0a 28 | of hype|rlinks.(|
|00000e70| 64 65 66 69 6e 65 64 20 | 62 79 20 74 68 65 20 5c |defined |by the \|
|00000e80| 63 6f 64 65 7b 68 72 65 | 66 7d 20 61 72 67 75 6d |code{hre|f} argum|
|00000e90| 65 6e 74 29 20 77 69 74 | 68 69 6e 20 74 68 65 20 |ent) wit|hin the |
|00000ea0| 64 6f 63 75 6d 65 6e 74 | 2e 20 20 54 68 65 20 6c |document|. The l|
|00000eb0| 69 73 74 0a 6f 66 20 68 | 79 70 65 72 6c 69 6e 6b |ist.of h|yperlink|
|00000ec0| 73 20 69 73 20 61 76 61 | 69 6c 61 62 6c 65 20 61 |s is ava|ilable a|
|00000ed0| 73 20 74 68 65 20 64 61 | 74 61 20 61 74 74 72 69 |s the da|ta attri|
|00000ee0| 62 75 74 65 20 5c 63 6f | 64 65 7b 61 6e 63 68 6f |bute \co|de{ancho|
|00000ef0| 72 6c 69 73 74 7d 2e 0a | 5c 65 6e 64 7b 66 75 6e |rlist}..|\end{fun|
|00000f00| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00000f10| 75 6e 63 64 65 73 63 7d | 7b 61 6e 63 68 6f 72 5f |uncdesc}|{anchor_|
|00000f20| 65 6e 64 7d 7b 7d 0a 54 | 68 69 73 20 6d 65 74 68 |end}{}.T|his meth|
|00000f30| 6f 64 20 69 73 20 63 61 | 6c 6c 65 64 20 61 74 20 |od is ca|lled at |
|00000f40| 74 68 65 20 65 6e 64 20 | 6f 66 20 61 6e 20 61 6e |the end |of an an|
|00000f50| 63 68 6f 72 20 72 65 67 | 69 6f 6e 2e 20 20 54 68 |chor reg|ion. Th|
|00000f60| 65 20 64 65 66 61 75 6c | 74 0a 69 6d 70 6c 65 6d |e defaul|t.implem|
|00000f70| 65 6e 74 61 74 69 6f 6e | 20 61 64 64 73 20 61 20 |entation| adds a |
|00000f80| 74 65 78 74 75 61 6c 20 | 66 6f 6f 74 6e 6f 74 65 |textual |footnote|
|00000f90| 20 6d 61 72 6b 65 72 20 | 75 73 69 6e 67 20 61 6e | marker |using an|
|00000fa0| 20 69 6e 64 65 78 20 69 | 6e 74 6f 20 74 68 65 0a | index i|nto the.|
|00000fb0| 6c 69 73 74 20 6f 66 20 | 68 79 70 65 72 6c 69 6e |list of |hyperlin|
|00000fc0| 6b 73 20 63 72 65 61 74 | 65 64 20 62 79 20 5c 63 |ks creat|ed by \c|
|00000fd0| 6f 64 65 7b 61 6e 63 68 | 6f 72 5f 62 67 6e 28 29 |ode{anch|or_bgn()|
|00000fe0| 7d 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |}..\end{|funcdesc|
|00000ff0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00001000| 73 63 7d 7b 68 61 6e 64 | 6c 65 5f 69 6d 61 67 65 |sc}{hand|le_image|
|00001010| 7d 7b 73 6f 75 72 63 65 | 5c 2c 20 61 6c 74 5c 6f |}{source|\, alt\o|
|00001020| 70 74 69 6f 6e 61 6c 7b | 5c 2c 20 69 73 6d 61 70 |ptional{|\, ismap|
|00001030| 5c 6f 70 74 69 6f 6e 61 | 6c 7b 5c 2c 20 61 6c 69 |\optiona|l{\, ali|
|00001040| 67 6e 5c 6f 70 74 69 6f | 6e 61 6c 7b 5c 2c 20 77 |gn\optio|nal{\, w|
|00001050| 69 64 74 68 5c 6f 70 74 | 69 6f 6e 61 6c 7b 5c 2c |idth\opt|ional{\,|
|00001060| 20 68 65 69 67 68 74 7d | 7d 7d 7d 7d 0a 54 68 69 | height}|}}}}.Thi|
|00001070| 73 20 6d 65 74 68 6f 64 | 20 69 73 20 63 61 6c 6c |s method| is call|
|00001080| 65 64 20 74 6f 20 68 61 | 6e 64 6c 65 20 69 6d 61 |ed to ha|ndle ima|
|00001090| 67 65 73 2e 20 20 54 68 | 65 20 64 65 66 61 75 6c |ges. Th|e defaul|
|000010a0| 74 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |t implem|entation|
|000010b0| 0a 73 69 6d 70 6c 79 20 | 70 61 73 73 65 73 20 74 |.simply |passes t|
|000010c0| 68 65 20 5c 63 6f 64 65 | 7b 61 6c 74 7d 20 76 61 |he \code|{alt} va|
|000010d0| 6c 75 65 20 74 6f 20 74 | 68 65 20 5c 63 6f 64 65 |lue to t|he \code|
|000010e0| 7b 68 61 6e 64 6c 65 5f | 64 61 74 61 28 29 7d 0a |{handle_|data()}.|
|000010f0| 6d 65 74 68 6f 64 2e 0a | 5c 65 6e 64 7b 66 75 6e |method..|\end{fun|
|00001100| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00001110| 75 6e 63 64 65 73 63 7d | 7b 73 61 76 65 5f 62 67 |uncdesc}|{save_bg|
|00001120| 6e 7d 7b 7d 0a 42 65 67 | 69 6e 73 20 73 61 76 69 |n}{}.Beg|ins savi|
|00001130| 6e 67 20 63 68 61 72 61 | 63 74 65 72 20 64 61 74 |ng chara|cter dat|
|00001140| 61 20 69 6e 20 61 20 62 | 75 66 66 65 72 20 69 6e |a in a b|uffer in|
|00001150| 73 74 65 61 64 20 6f 66 | 20 73 65 6e 64 69 6e 67 |stead of| sending|
|00001160| 20 69 74 20 74 6f 20 74 | 68 65 0a 66 6f 72 6d 61 | it to t|he.forma|
|00001170| 74 74 65 72 20 6f 62 6a | 65 63 74 2e 20 20 52 65 |tter obj|ect. Re|
|00001180| 74 72 69 65 76 65 20 74 | 68 65 20 73 74 6f 72 65 |trieve t|he store|
|00001190| 64 20 64 61 74 61 20 76 | 69 61 20 5c 63 6f 64 65 |d data v|ia \code|
|000011a0| 7b 73 61 76 65 5f 65 6e | 64 28 29 7d 0a 55 73 65 |{save_en|d()}.Use|
|000011b0| 20 6f 66 20 74 68 65 20 | 5c 63 6f 64 65 7b 73 61 | of the |\code{sa|
|000011c0| 76 65 5f 62 67 6e 28 29 | 7d 20 2f 20 5c 63 6f 64 |ve_bgn()|} / \cod|
|000011d0| 65 7b 73 61 76 65 5f 65 | 6e 64 28 29 7d 20 70 61 |e{save_e|nd()} pa|
|000011e0| 69 72 20 6d 61 79 20 6e | 6f 74 20 62 65 0a 6e 65 |ir may n|ot be.ne|
|000011f0| 73 74 65 64 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |sted..\e|nd{funcd|
|00001200| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00001210| 63 64 65 73 63 7d 7b 73 | 61 76 65 5f 65 6e 64 7d |cdesc}{s|ave_end}|
|00001220| 7b 7d 0a 45 6e 64 73 20 | 62 75 66 66 65 72 69 6e |{}.Ends |bufferin|
|00001230| 67 20 63 68 61 72 61 63 | 74 65 72 20 64 61 74 61 |g charac|ter data|
|00001240| 20 61 6e 64 20 72 65 74 | 75 72 6e 73 20 61 6c 6c | and ret|urns all|
|00001250| 20 64 61 74 61 20 73 61 | 76 65 64 20 73 69 6e 63 | data sa|ved sinc|
|00001260| 65 20 74 68 65 0a 70 72 | 65 63 65 65 64 69 6e 67 |e the.pr|eceeding|
|00001270| 20 63 61 6c 6c 20 74 6f | 20 5c 63 6f 64 65 7b 73 | call to| \code{s|
|00001280| 61 76 65 5f 62 67 6e 28 | 29 7d 2e 20 20 49 66 20 |ave_bgn(|)}. If |
|00001290| 5c 63 6f 64 65 7b 6e 6f | 66 69 6c 6c 7d 20 66 6c |\code{no|fill} fl|
|000012a0| 61 67 20 69 73 20 66 61 | 6c 73 65 2c 0a 77 68 69 |ag is fa|lse,.whi|
|000012b0| 74 65 73 70 61 63 65 20 | 69 73 20 63 6f 6c 6c 61 |tespace |is colla|
|000012c0| 70 73 65 64 20 74 6f 20 | 73 69 6e 67 6c 65 20 73 |psed to |single s|
|000012d0| 70 61 63 65 73 2e 20 20 | 41 20 63 61 6c 6c 20 74 |paces. |A call t|
|000012e0| 6f 20 74 68 69 73 20 6d | 65 74 68 6f 64 0a 77 69 |o this m|ethod.wi|
|000012f0| 74 68 6f 75 74 20 61 20 | 70 72 65 63 65 65 64 69 |thout a |preceedi|
|00001300| 6e 67 20 63 61 6c 6c 20 | 74 6f 20 5c 63 6f 64 65 |ng call |to \code|
|00001310| 7b 73 61 76 65 5f 62 67 | 6e 28 29 7d 20 77 69 6c |{save_bg|n()} wil|
|00001320| 6c 20 72 61 69 73 65 20 | 61 0a 5c 63 6f 64 65 7b |l raise |a.\code{|
|00001330| 54 79 70 65 45 72 72 6f | 72 7d 20 65 78 63 65 70 |TypeErro|r} excep|
|00001340| 74 69 6f 6e 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |tion..\e|nd{funcd|
|00001350| 65 73 63 7d 0a | |esc}. | |
+--------+-------------------------+-------------------------+--------+--------+