HTML stripper

This forum is for general support of Xbase++
Post Reply
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

HTML stripper

#1 Post by skiman »

Hi,

I'm looking for some code to strip HTML code to ascii-text without tags and attributes. Is anyone using something to accomplish this?
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: HTML stripper

#2 Post by skiman »

This is some code I want to strip automatically:

Code: Select all

<b>Zeer krachtig</b><br>Dankzij de krachtige processors van de Aspire V3-serie en de dubbele harde schijf wordt multitasken kinderspel.1 Geniet van superieure prestaties en beelden met de nieuwste Intel®- of AMD-processors en uitstekende NVIDIA®- of AMD-graphics. Of u nu films of muziek bewerkt of op internet surft, uw digitale ervaring is altijd weergaloos.<br><br><b>Show to go</b><br>Geniet gewoon <span id="long_desc_more">... <a class="more" style="font-size: 12px;font-weight: bold" href="javascript:show_more()">Meer>>></a></span><span id="more_text" style="display: none">bij u thuis van de mooiste beelden en het prachtigste geluid met het Acer CineCrystal™ HD-beeldscherm, Dolby® Home Theater® v4 en een Blu-ray Disc™-station.1 Dankzij HDMI® kunt u alles eenvoudig op uw eigen tv bekijken en wordt uw Aspire V3-notebook een echt entertainmentcenter!<br><br><b>Praten, delen</b><br>Blijf in contact met familie en vrienden met de nieuwste Wi-Fi®-verbinding en supersnel Gigabit Ethernet. Geniet van heldere videochats met de geïntegreerde Acer Crystal Eye HD-webcam. Zet mediabestanden draadloos over met Bluetooth®1 en deel uw foto's tijdens het chatten. En met AcerCloud deelt u foto's, video's, muziek en documenten binnen enkele seconden op al uw apparaten!<br><br><b>Prachtig design</b><br>De Aspire V3-serie is beschikbaar in diverse trendy kleuren. De buitenkant is in dezelfde glanzende kleur afgewerkt als de schermrand en de polssteun, wat een aangename en harmonieuze uitstraling geeft. Het ergonomische chiclet-toetsenbord en de multi-gesture touchpad - standaard op alle drie de modellen - zorgen voor nog meer comfort en productiviteit.</span><span style="display: none" id="long_desc_less"><a class="more" style="font-size: 12px;font-weight: bold" href="javascript:hide_more()"> <<<Minder</span>
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: HTML stripper

#3 Post by rdonnay »

If this HTML is formatted properly, like XML, then I could write you something that would use DC_XmlNode(). I could read it into a document tree and then write it back out again without the tags. It would fail however on tags like <br>.

Possibly, I could Strtran() out the <br> tags first and that may work.
Could you send me the EXACT html code so I can look at it closer?
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: HTML stripper

#4 Post by skiman »

Hi Roger,

Thanks for the offer. At this moment I'm trying to get this done with regular expressions. If I succeed you don't have to look for this.
Best regards,

Chris.
www.aboservice.be

Post Reply