473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

parse string with xml contents

Hi

I have a string with the following contents:

"<TR align=right ID=G><TD align=left><A
HREF="/comun/fichaemp/fichavalor.asp?isin=ES0111845014"><IMG
SRC="/images/arr-up9.gif" BORDER=0> ABERTIS
SE.A</A></TD><TD>19,96</TD><TD
ID=V>0,15</TD><TD>19,96</TD><TD>19,83</TD><TD>1.060.525</TD><TD>21.115,00</TD><TD
align=center>27/06/2005</TD><TD align=center>17:35</TD></TR>"

What would be the simplest way to parse it, and keep only "ABERTIS
SE.A" and (the first) "19,96"?

Thank you,
Nov 12 '05 #1
1 1189


Mochuelo wrote:

I have a string with the following contents:

"<TR align=right ID=G><TD align=left><A
HREF="/comun/fichaemp/fichavalor.asp?isin=ES0111845014"><IMG
SRC="/images/arr-up9.gif" BORDER=0> ABERTIS
SE.A</A></TD><TD>19,96</TD><TD
ID=V>0,15</TD><TD>19,96</TD><TD>19,83</TD><TD>1.060.525</TD><TD>21.115,00</TD><TD
align=center>27/06/2005</TD><TD align=center>17:35</TD></TR>"

What would be the simplest way to parse it, and keep only "ABERTIS
SE.A" and (the first) "19,96"?


The string does not contain XML but rather a snippet of HTML so you
can't parse it with an XML parser. If you want to parse HTML with .NET
then you can use SGMLReader
<http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=b90fddce-e60d-43f8-a5c4-c3bd760564bc>

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

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

Similar topics

1
by: chuck amadi | last post by:
By the way list is there a better way than using the readlines() to > > >parse the mail data into a file , because Im using > > >email.message_from_file it returns > > >all the data i.e reads one...
3
by: IWP506 | last post by:
Hey, I have a lot of common things I want to be included on different pages (i.e. the page title, the header, some buttons and such, etc.). So I was thinking of putting things like...
9
by: Danny | last post by:
HI again Is there a nifty function in access that will: 1. return the amount of occurances of a small string within a larger string? this<br>is<br>a<br>test would return 3 for <br>
11
by: hoopsho | last post by:
Hi Everyone, I am trying to write a program that does a few things very fast and with efficient use of memory... a) I need to parse a space-delimited file that is really large, upwards fo a...
3
by: Kevin Kenny | last post by:
Dear All, I have a date time validation method thus: public static bool IsDate(string date, System.IFormatProvider provider) { try { DateTime.Parse(date, provider) return true; } catch...
6
by: Richard | last post by:
Which way would you guys recommened to best parse a multiline file which contains two fields seperated by a tab. In this case its the linux/proc/filesystems file a sample of which I have included...
1
by: Ronald S. Cook | last post by:
I have a string (see below) that I want to parse out the values. As you can see, some are element-based and some are attribute-based. <METADATA version="Format5"><TITLE value="Adrenaline...
5
by: meendar | last post by:
Hi, I just want to parse a character string as below Char * c=abcsyd"loddggg"kjskjdfsdf; I need to stripe out loddgg from c (inside ""). How can i do this in c?
7
by: pedrito | last post by:
I get exception trying to parse this URI: http://-eeayr4mwvtw998.usercash.com/ But IE and Firefox have no problem opening it. The parse exception is actually happening inside an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.