HTML tags optimization [ interesting problem]




hi all,

i use SGMLParser to process HTML files, in order to do some
optimizations,

something like this:

<i><b>TEXT1</b></i><b><i><u>TEXT2</u></i></b>

optimise to

<i><b>TEXT1<u>TEXT2</u></b><i>


at the very beginning, i was thinking of analysing each text-block, to
know their color, size, if is bold or italic, but i found it was too
complicated.

e.g

<font color=red><font size=6>TEXT1</font></font>

optimise to

<font color=red size=6>TEXT1</font>


but if there is TEXT2 exist

<font color=red><font size=6>TEXT1</font>TEXT2</font>

we can not do any optimization.

my problem is I can not find a method to treat all those situation, I
had too much thinking and get fool now


anyone can give me some advices?

thanks




PS:

other examples:

1
<font size=5><font size=7>TEXT</font></font>
=>
<font size=7>TEXT</font>

2
<i>TEXT </i><i>TEXT</i>
=>
<i>TEXT TEXT</i>

3
<i>TEXT<i>TEXT</i></i>
=>
<i>TEXT</i>

etc...

.



Relevant Pages

  • Re: PS CS - Image Resize in Pixels ?
    ... > click on the small arrow next to preset, and you can choose 'optimise to ... Prev by Date: ...
    (comp.graphics.apps.photoshop)
  • Re: PS CS - Image Resize in Pixels ?
    ... >> click on the small arrow next to preset, and you can choose 'optimise to ... Prev by Date: ...
    (comp.graphics.apps.photoshop)
  • Re: Zs instead of Ss on Borland UK
    ... > while the Brits have fallen into error :-( ... (like optimise and analyse), so I hope you forgive me for writing ... Groetjes, ... Prev by Date: ...
    (borland.public.delphi.non-technical)
  • Re: Search engine optimizing.
    ... This site will provide you with ALL the tools to optimise your website for ... > own homepage to the top, by searching witch google? ... Prev by Date: ...
    (alt.internet.search-engines)
  • Re: Turning off the optimizer
    ... One of the main issues is simply the amount of time CW will spend on ... need an 850Mb defuse mem limit to optimise this function!). ... that optimization off with a pragma? ... Prev by Date: ...
    (comp.sys.mac.programmer.codewarrior)