473,796 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Markup to Text

Hello grp:

I have a situation I was hoping someone might be able to suggest a solution.
I am retrieving html from a url and storing this information in Sql Server.
Our web service supplies this data to our clients via a web service that is
a client of the ws and to integration clients as xml data (HTML is encoded
in CDATA). We have an integration client who cannot accept html embedded in
the xml for whatever reason. Due to the large volume of this client, we are
tasked with coming up with a robust solution to convert the html markup to
an equivalent text representation. In the short term, we are removing the
html formatting and replacing it with regex, but this solution is not very
robust or particularly effective due to table structures not translating
very well. I have been looking for an 'HTML Stripper' tool but searching
Google hasn't yielded too much. Most of these tools are either gui-based or
require files for input. Neither one of these options will work for us
since this needs to run in a 'service' context without user interaction.

Does anyone know of an effective way to either handle the markup or know of
a COM object library that provides support for HTML tables?

Some things we have tried to date include HTMLDocument class (formatting is
not preserved), XHTML conversion followed by xslt parsing (effective but not
very efficient) and, as already mentioned, regex.

Any help is much appreciated,

Alex
Nov 15 '05 #1
1 1705
Have you at all considered maybe using the IE component framework to load
the HTML script and provide an object model ready to be programmed against?
Surely Internet Explorer can provide the majority of functionality to
extract the munged data you require. Maybe there are HTML parsers as
components ready for your use - I am sure there are some ActiveX parsers.
If there arent, have you also considered building the parser?

Nick.

"Trebek" <tr****@inthefo rmofaquestion.c om> wrote in message
news:40******** *************** @nnrp.fuse.net. ..
Hello grp:

I have a situation I was hoping someone might be able to suggest a solution. I am retrieving html from a url and storing this information in Sql Server. Our web service supplies this data to our clients via a web service that is a client of the ws and to integration clients as xml data (HTML is encoded
in CDATA). We have an integration client who cannot accept html embedded in the xml for whatever reason. Due to the large volume of this client, we are tasked with coming up with a robust solution to convert the html markup to
an equivalent text representation. In the short term, we are removing the
html formatting and replacing it with regex, but this solution is not very
robust or particularly effective due to table structures not translating
very well. I have been looking for an 'HTML Stripper' tool but searching
Google hasn't yielded too much. Most of these tools are either gui-based or require files for input. Neither one of these options will work for us
since this needs to run in a 'service' context without user interaction.

Does anyone know of an effective way to either handle the markup or know of a COM object library that provides support for HTML tables?

Some things we have tried to date include HTMLDocument class (formatting is not preserved), XHTML conversion followed by xslt parsing (effective but not very efficient) and, as already mentioned, regex.

Any help is much appreciated,

Alex

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2203
by: Jacek Generowicz | last post by:
:::Title::: A simple text markup utility :::/Title::: :::Section Introduction ::: I'm looking for something to help developers wirte documentation for bits of software they are writing. The main (initially only) presentation format will be HTML. The idea is to allow the author to write a plain text file containing the text he wishes to present, annotated with minimally intrusive markup which describes the :::emph::: meaning...
30
3490
by: Reinhold Birkenfeld | last post by:
Hello, I know that there are different YAML engines for Python out there (Syck, PyYaml, more?). Which one do you use, and why? For those of you who don't know what YAML is: visit http://yaml.org/! You will be amazed, and never think of XML again. Well, almost.
47
3261
by: Andy Dingley | last post by:
Assume an English language page, linking to a foreign history resource that's only available in a foreign language. Any suggestions on appropriate "best practice" markup, particularly regarding the scope of a lang attribute applied to a <a> element ? <p>Francisco de Miranda's <a href="http://www.simon-bolivar.org/bolivar/miranda_oci.html" title="Biography of Francisco de Miranda (in Spanish)" lang="es" >biography</a></p>
7
3442
by: Lachlan Hunt | last post by:
Hi, I have recently downloaded and experemented with IBM HPR 3.0, and Opera 8 with text-to-speech, and have come to realise some fairly annoying issues regarding punctuation marks. I've found, that when a punctuation mark occurs directly after an element, both HPR and Opera 8 will read the punctuation mark. For example, the following: <p><abbr title="...">HTML</abbr> is an application of
2
3485
by: neovantage | last post by:
Hey all, I have created transparent PNG images from text dynamically. But it edges are pixel-ate or we can say edges are distorted. Here is my LINK which shows my generated transparent PNG image. Can someone help me out to sort out my problem i will be very grateful to him as i am stuck bad with this issue and i am not figuring out how to fix this. Here is my Code which generate transparent PNG images <img...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9057
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.