|
Suppose something like this:
[code]
<span class="gugugug">1</span>
<span class="krakaka">enchanted</span><span class="gagaga">chocolate bar</span>
<span class="gugugug">2</span>
<span class="krakaka">very remarkable</span><span class="gagaga">flavored cookies</span>
<span class="gugugug">3</span>
<span class="krakaka">fascinating</span><span class="gagaga">strawberries</span>
(...)
<span class="gugugug">254</span>
<span class="krakaka">amazing</span><span class="gagaga">pineapples</span>
(...)
[/code]
And it goes on.
I need to extract the numbers and words between the <span> and </span> tags ("1", "enchanted", "chocolate bar", "2", "very remarkable", and so on) and put it in a bidimensional array. But what piece of code do I need in order to extract from between the tags?
I'm imagining it's something easy, but I'm completely new, whereas you guys are extremely good, so please help.
|
|
|
|
|
Have you checked out MSXML? It will parse the xml and let you deal with through an object model.
|
|
|
|
|
I do not know what language you are using, but since it is posted under C/C++/MFC tab, I assume that it is....Pardon me, I just came here through a google search so I found the post under C/C++/MFC tab. Now as said by the previous reply u got, you can use MSXML. Or if you have an option of using .NET (C# or VB.NET), then you can just make use of HTMLDocument, HTMLElement, HTMLElementCollection classes, and get the tags and the info inside them. Then use .NET interop to bring them to native C++. Or you can just use /clr option that VC++ compiler provides u and write managed code in C++ application as well...Other than that, I am also waiting for a good method or previous code that has been posted on the net to do it. I had hoped to find some information about this on MSDN, but in vain. Eventually, I hope something in this regards is posted some where...
Bhushan
|
|
|
|
|
In this message board the correct assumption is native C/C++. There are seperate message boards for .net, C#, and managed C++. So the best answer is MSXML and there are plenty of examples available by googling MSXML Examples.
|
|
|
|
|
There is also this[^] and I am sure many more like it. MSXML is not the only option.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
hi anybody.
i have tried the wait function in the forum .
it works fine in taking pictures with cameras like :
<pre>camera1.release();
wait(1);
camera2.release();</pre>
but when i try showing images in picture box with time interval and the same wait function , the program freezes and only shows the last image after all of waits.
i mean if we have 6 images in program and 10 seconds waiting interval , the last image shown after 10 seconds.
my yahoo id is :mshankayi@yahoo.com
mail :mohd109@gmail.com
i really need to know where is the problem
if anyone wants all the code for helping please just email me.
thanks in advance
sincerely
Mohammad Shankayi
|
|
|
|
|
I'm not sure what wait() is but if it behaves like Sleep() does, the primary thread will be blocked until that function returns. When the primary thread is blocked, it's not going to be processing any messages.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
great
that's it
and one question : what class in .net can do what i want
because it's a simple function.
not to sleep just do sth in time intervals.
thanks a lot
sincerely
Mohammad Shankayi
|
|
|
|
|
If you want to display a picture roughly every 10 seconds, call SetTimer(10000). Draw the picture in/from the WM_TIMER handler function.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
If you're doing this in .net, then this is not the best forum to come for help.
There's a C# and a C++/CLI one.
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi guys,
I implemented Class Time with private members and public function, any way I used to declare friend function to access those private data members.
The first Time give me the right value but the second gives me 0 Zeroooos I done know why
And the header is follwing over here
#pragma once
#include <iostream>
using namespace std;
class Time
{
private:
int hour;
int minute;
int second;
public:
Time();
Time(int hour,int minute,int second);
void setTime();
int getHour(int h);
int getMinute(int m);
int getSecond(int s);
void printTime();
friend ostream & operator<<(ostream& , Time);
friend istream& operator>>(istream&,Time);
};
.CPP
Time::Time()
{
this-> hour = 0;
this-> minute = 0;
this-> second = 0;
}
Time::Time(int h,int m, int s)
{
this-> hour = h;
this-> second = s;
this-> minute = m;
}
istream & operator>>(istream &in ,Time t2 )
{
in>>t2.hour>>t2.minute>>t2.second;
return in;
}
ostream& operator<<(ostream &o, Time t2 )
{
o<<t2.hour<<t2.minute<<t2.second;
return o;
}
Finally the main
Time t(1,22,22);
Time t2;
cout<<"The first Time is:\n";
cout<<t;
cout<<endl;
cout<<"Enter the second time\n";
cin>>t2;
cout<<"2nd time\n";
cout<<t2;
cout<<endl;
system("pause");
return 0;
|
|
|
|
|
dr.nokia wrote: istream & operator>>(istream &in ,Time t2 )
This function is not changing the t2 variable that was created in main() . Change the second parameter to a reference instead.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
dr.nokia wrote: istream & operator>>(istream &in ,Time t2 )
{
in>>t2.hour>>t2.minute>>t2.second;
return in;
}
you need pass a reference to change the actual object:
istream & operator>>(istream &in ,Time & t2 )
{
in>>t2.hour>>t2.minute>>t2.second;
return in;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanx alot guys now it works I forgot to add this (&)
|
|
|
|
|
A running exe checks version info, if find new, can the exe download new version of itself and replace the exe? is the peplace process trusted?
|
|
|
|
|
includeh10 wrote: can the exe download new version of itself
Yes
includeh10 wrote: and replace the exe?
No, the exe file will be locked by the OS as it is a running process. You can however save the new file under a different name and call the MoveFile function and specify the MOVEFILE_DELAY_UNTIL_REBOOT flag to have the OS replace the exe file the next time the machine is rebooted.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Hi I want to Develop a Dictionary Application what data structure i have to use so that my searching becomes becomes faster and the data organized properly.....
|
|
|
|
|
A Simple data structure for Dictionary, at least for "European" type languages is the Trie[^].
This signature was proudly tested on animals.
|
|
|
|
|
Great. What's your question? "How to start?" does not count.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Hi
I just got encrypt ActiveX dll. I want to it use without registering it.
Any sample would be greatly appreciated.
Best regards,
|
|
|
|
|
ActiveX can not be used if without register it.
but you can register it in main program, so it looks not registered - or you can unregister it when main app exists.
MSDN has a sample about how to register ActiveX, just a few of lines, very easy.
I can not remember the sample name - regsrv32 or some name similar to this.
modified on Friday, October 2, 2009 12:08 PM
|
|
|
|
|
regsvr32
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
includeh10 wrote: ActiveX can not be used if without register it.
This is not completely true.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
how so?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|