in reply to Re: processing text nodes using HTML::Element
in thread processing text nodes using HTML::Element
bbfu,
Thank you for your reply.
I perused your code, not running it. I trust it works. In fact, at one point I'd thought I'd have to do it "your" way.
Let me backtrack and get certain facts straight. From my reading of the documentation I understand there are two ways of controlling how the printed output of a document tree will look.
(a) The $entities parameter passed to the as_HTML method.
(b) Using the '~literal' pseudo-element.
Am I right or missing something ?
Let me keep on ruminating. In my situation, I've dozens of HTML files whose contents I know nothing about, and should not have to care to know about. By contents I mean text the user can see rendered in the browser—not markup.
My program reflects the following process:
(a) read an HTML input file;
(b) construct a document tree;
(c) repair text nodes, traversing the tree;
(d) print the tree as an HTML file.
Suppose my input HTML file contains the following string:
— ©
When my program goes through steps (a), (b) and (d), omitting the step (c), the string in the output file is DIFFERENT from that in the input file.
Before I go any further in this conversation, let me pause here and ask this question:
Do you know how to get from the document tree exactly the same text as “went into” the tree ?
Thank you for your time.
Cheers
P.S.
I'm using ActiveState's Perl 5.6.1 on Win2K.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re3: processing text nodes using HTML::Element
by bbfu (Curate) on Mar 09, 2003 at 23:58 UTC |